windows 无法进入远程 SQL Server 2008 上的存储过程

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/2512244/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-15 14:11:06  来源:igfitidea点击:

Can't step into stored procedure on remote SQL Server 2008

windowsvisual-studiosql-server-2008windows-server-2008remote-debugging

提问by abatishchev

I have a domain controller installed on virtual Windows Server 2008 x64.

我在 virtual 上安装了域控制器Windows Server 2008 x64

SQL Server 2008 Express x64is running on Windows Server 2008 x64and client on Windows 7 RTM x86. Both have joined the domain.

SQL Server 2008 Express x64正在运行Windows Server 2008 x64,客户端在Windows 7 RTM x86. 两者都已加入域。

I'm starting both Visual Studio 2008and SQL Server Management Studio 2008under domain admin user. This account is a member of group sysadminon SQL Server.

我开始都Visual Studio 2008SQL Server Management Studio 2008下域管理员用户。此帐户是组的成员sysadminSQL Server

Server has firewall exceptions for both TCPand UDPon ports 135-139and 1433-1434.

服务器有两个防火墙例外TCP,并UDP在端口135-1391433-1434

Visual Studio 2008 Remote Debuggerservices is started on server and Domain Adminsgroup is allowed to debug.

Visual Studio 2008 Remote Debugger服务在服务器上启动,并且Domain Admins允许组进行调试。

Remote DCOM works: I can attach to remote server and list it's processes, can switch to show only managed code, etc.

远程 DCOM 工作:我可以连接到远程服务器并列出它的进程,可以切换到仅显示托管代码等。

When I'm starting debugging of a query in SMS I'm getting this error:

当我开始调试 SMS 中的查询时,出现此错误:

Failed to start debugger Error HRESULT E_FAIL has been returned from a call to a COM component. (mscorlib) Program Location:

at System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

at Microsoft.SqlServer.Management.UI.VSIntegration.DebugSession.DebugCallbacks.OnSqlInitializeDebuggingEvent(ISqlInitializeDebuggingEvent sqlInitializeDebuggingEvent)

at Microsoft.SqlServer.Management.UI.VSIntegration.DebugSession.DebugCallbacks.Microsoft.VisualStudio.Debugger.Interop.IDebugEventCallback2.Event(IDebugEngine2 debugEngine, IDebugProcess2 debugProcess, IDebugProgram2 debugProgram, IDebugThread2 debugThread, IDebugEvent2 debugEvent, Guid& riidEvent, UInt32 attribute)

无法启动调试器错误 HRESULT E_FAIL 已从对 COM 组件的调用返回。(mscorlib) 程序位置:

在 System.Runtime.InteropServices.Marshal.ThrowExceptionForHRInternal(Int32 errorCode, IntPtr errorInfo)

在 Microsoft.SqlServer.Management.UI.VSIntegration.DebugSession.DebugCallbacks.OnSqlInitializeDebuggingEvent(ISqlInitializeDebuggingEvent sqlInitializeDebuggingEvent)

在 Microsoft.SqlServer.Management.UI.VSIntegration.DebugSession.DebugCallbacks.Microsoft.VisualStudio.Debugger.Interop.IDebugEventCallback2.Event(IDebugEngine2 debugEngine, IDebugProcess2 debugProcess, IDebugProgram2 debugProgram, IDebugThread2 debugThread, IDebugEvent2 debugEvent, Guid& riidEvent, UInt32 属性)

and

Unable to access the SQL Server debugging interface. The Visual Studio debugger cannot connect to the remote computer. A firewall may be preventing communication via DCOM to the remote computer. Please see Help for assistance.

无法访问 SQL Server 调试界面。Visual Studio 调试器无法连接到远程计算机。防火墙可能会阻止通过 DCOM 与远程计算机进行通信。请参阅帮助以获得帮助。

and

Unable to start program MSSSQL://server.mydomain.local/master/sys/=0

无法启动程序 MSSSQL://server.mydomain.local/master/sys/=0

And when stepping-in into a stored procedure using VS I'm getting the first one and this:

当使用 VS 进入存储过程时,我得到了第一个和这个:

Exception from HRESULT: 0x89710016

来自 HRESULT 的异常:0x89710016

What have I do?

我做了什么?

回答by AMissico

Once I disabled the firewall on both client and server, it worked.

一旦我禁用了客户端和服务器上的防火墙,它就起作用了。

回答by SoftwareGeek

You have to enable remote debugging on the database. You could run the following to do that.

您必须在数据库上启用远程调试。您可以运行以下命令来做到这一点。

%ProgramFiles%\Microsoft SQL Server\100\Shared\1033\rdbgsetup.exe

%ProgramFiles%\Microsoft SQL Server\100\Shared\1033\rdbgsetup.exe

Also, make sure you can connect to the remote SQLServer before you debug, since your logs point to a connection issue.

此外,请确保在调试之前可以连接到远程 SQLServer,因为您的日志指向连接问题。

回答by schrodinger's code

can you check if you meet the requirements of this article? it works for me.

你能检查一下你是否符合这篇文章的要求吗?这个对我有用。