无法启动 Transact-SQL 调试器,无法连接到数据库引擎实例

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/24491024/
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-01 02:09:02  来源:igfitidea点击:

Unable to start the Transact-SQL debugger, could not connect to the database engine instance

sqltsqldebugging

提问by connersz

I have been trying to run debugging within SQl server management studio and for some reason the debugger has just stopped working.

我一直在尝试在 SQl 服务器管理工​​作室中运行调试,但由于某种原因调试器刚刚停止工作。

This is the message I get:

这是我得到的消息:

Unable to start the Transact-SQL debugger, could not connect to the database engine instance 'server-sql'. Make sure you have enabled the debugging firewall exceptions and are using a login that is a member of the sysadmin fixed server role. The RPS server is unavailable.

无法启动 Transact-SQL 调试器,无法连接到数据库引擎实例“server-sql”。确保您已启用调试防火墙例外,并且使用的登录名是 sysadmin 固定服务器角色的成员。RPS 服务器不可用。

Before this I get two messages, one requesting firewall permissions and the next says 'usage' with some text that makes little sense.

在此之前,我收到两条消息,一条请求防火墙权限,下一条说“用法”,其中包含一些毫无意义的文本。

I have looked at the other similar answers on there for the same message which suggest adding the login as a sysadmin but that is already set. I also tried adding sysadmin to another account but that also didn't work.

我已经在那里查看了相同消息的其他类似答案,这些答案建议将登录名添加为系统管理员,但已经设置。我也尝试将 sysadmin 添加到另一个帐户,但这也不起作用。

采纳答案by connersz

In the end I was able to start it by right clicking and selecting run as administrator.

最后,我可以通过右键单击并选择以管理员身份运行来启动它。

回答by jRosenholm

I just wanted to pay this forward, as after searching for quite some time I've yet to see anyone mention the problem that I encountered here.

我只是想提前支付这笔费用,因为在搜索了很长一段时间后,我还没有看到有人提到我在这里遇到的问题。

I encountered this issue while connected to SQL using a SQL Server Authenticated user. Once I tried using a Windows Authenticated user I was able to debug without issue. That user must also be assigned the sysadmin role.

我在使用 SQL Server Authenticated 用户连接到 SQL 时遇到了这个问题。一旦我尝试使用 Windows Authenticated 用户,我就可以毫无问题地进行调试。还必须为该用户分配 sysadmin 角色。

Hope this helps someone somewhere.

希望这可以帮助某人某处。

回答by Frank Robinson

This happened to me and I could not find the resolution anywhere. My firewall is disabled so I knew that couldn't be the issue.

这发生在我身上,我在任何地方都找不到解决方案。我的防火墙被禁用,所以我知道这不是问题。

According to Microsoft: Configure firewall rules before running the TSQL Debugger:

根据Microsoft:在运行 TSQL 调试器之前配置防火墙规则

The server needs to communicate back to the client via RPC. The account under which SQL Server service is running should have authenticate permissions to the client.

服务器需要通过 RPC 与客户端通信。运行 SQL Server 服务的帐户应具有对客户端的身份验证权限。

We had a group policy that was preventing this:

我们有一个阻止这种情况的组策略:

Deny access to this computer from the network (Local account, Guests)

拒绝从网络访问这台计算机(本地帐户、来宾)

In order to resolve the issue, I had to add the SQL Server service account to the local group "Remote Desktop Users" on my desktop. Hope this helps someone else resolve this frustrating issue.

为了解决该问题,我必须将 SQL Server 服务帐户添加到桌面上的本地组“远程桌面用户”。希望这可以帮助其他人解决这个令人沮丧的问题。

回答by FrenkyB

What helped me, was from here:

对我有帮助的是来自这里

SQL Server Management Studio must be running under a Windows account that is a member of the sysadmin fixed server roll.

The Database Engine Query Editor window must be connected by using either a Windows Authentication or SQL Server Authentication login that is a member of the sysadmin fixed server role.

SQL Server Management Studio 必须在作为 sysadmin 固定服务器卷成员的 Windows 帐户下运行。

必须使用作为 sysadmin 固定服务器角色成员的 Windows 身份验证或 SQL Server 身份验证登录名连接数据库引擎查询编辑器窗口。

So, I've added sysadmin role to my windows account and run ssms as administrator. Debugger started working normally.

因此,我已将 sysadmin 角色添加到我的 Windows 帐户并以管理员身份运行 ssms。调试器开始正常工作。

回答by Ehsan Abidi

In addition to above works, what make our 2 computers remote debug able, was running: (right click on Window's Start button)

除了上述工作之外,使我们的 2 台计算机能够远程调试的原因正在运行:(右键单击 Window 的“开始”按钮)

System--> Advanced System Properties-->Computer Name-->Click on Network ID...button

系统-->高级系统属性-->计算机名-->点击网络ID...按钮

and running that wizard to join workgroup on both computers.
I found this solution by looking at my Windows' Event Viewer and looking for a solution to errors with NetBT Source, that is related to workgroup and computer Name.
Update: after some days, it stop working again.

并运行该向导以加入两台计算机上的工作组。
我通过查看我的 Windows 的事件查看器并寻找 NetBT 源错误的解决方案找到了这个解决方案,这与工作组和计算机名称有关。
更新:几天后,它再次停止工作。

回答by Quethzel Díaz

I try with the following steps, but it did not work(maybe because I'm on a PC in a office and I don't have control of the firewall). But you can try the following.

我尝试执行以下步骤,但没有奏效(可能是因为我在办公室的 PC 上并且无法控制防火墙)。但是您可以尝试以下操作。

  1. Check the users role:

    IF IS_SRVROLEMEMBER ('sysadmin') = 1
    print 'Current user''s login is a member of the sysadmin role'
    
  2. Follow these instructions: configure the transact-SQL Debugger

  3. Run SQL Server Management Standard Edition 64 bits (with SQL Server Account)
  1. 检查用户角色:

    IF IS_SRVROLEMEMBER ('sysadmin') = 1
    print 'Current user''s login is a member of the sysadmin role'
    
  2. 按照以下说明操作: 配置 transact-SQL 调试器

  3. 运行 SQL Server 管理标准版 64 位(使用 SQL Server 帐户)

回答by Dio Phung

In my case, I received this error message:

就我而言,我收到此错误消息:

Unable to start the Transact-SQL debugger, could not connect to the computer "local".

无法启动 Transact-SQL 调试器,无法连接到“本地”计算机。

I end up close the existing connection, then reconnect to my local SQL server using IP 127.0.0.1 and it works.

我最终关闭了现有的连接,然后使用 IP 127.0.0.1 重新连接到我的本地 SQL 服务器并且它工作正常。

回答by Roeland

I had the same problem and double checked al recommended settings. At some point I disabled the firewall on the database server and it worked like a charm. By enabling and checking the Firewall log I noticed this entry:

我遇到了同样的问题,并仔细检查了所有推荐的设置。在某些时候,我禁用了数据库服务器上的防火墙,它就像一个魅力。通过启用和检查防火墙日志,我注意到了这个条目:

2019-10-31 16:07:50 DROP TCP192.168.xxx.xxx 192.168.xxx.xxx 65231 6121452 S 56576751 0 8192 - - - RECEIVE

2019-10-31 16:07:50 DROP TCP192.168.xxx.xxx 192.168.xxx.xxx 65231 6121452 S 56576751 0 8192 - - - 接收

When I allowed TCP port 61214 (Inbound rule) and switched the firewall back on, it worked. I don't know why this port is needed, maybe some here on SO?

当我允许 TCP 端口 61214(入站规则)并重新打开防火墙时,它起作用了。我不知道为什么需要这个端口,也许这里有一些?

Anyway, maybe the firewall log can be of help too.

无论如何,也许防火墙日志也可以提供帮助。