I have been trying to debug SQL Server 2005 stored procedures, in Visual Studio Team System 2008.
我一直在尝试在Visual Studio Team System 2008中调试SQL Server 2005存储过程。
I connected to the database server and did a right-click "Execute", on the stored procedure. I even tried "Step Into Stored Procedure", with no luck.
我连接到数据库服务器并在存储过程上右键单击“执行”。我甚至试过“踏入存储过程”,没有运气。
alt text http://ferdspics.googlepages.com/vs-executesproc.JPG
替代文字http://ferdspics.googlepages.com/vs-executesproc.JPG
The IDE shows it is running, but I can not seem to break or step into the stored procedure.
IDE显示它正在运行,但我似乎无法中断或进入存储过程。
alt text http://ferdspics.googlepages.com/vs-executesproc-ideshowsitsrunning.JPG
替代文字http://ferdspics.googlepages.com/vs-executesproc-ideshowsitsrunning.JPG
I have checked the event viewer and there are no logs. There are no output or messages showing where the problem is.
我检查了事件查看器,没有日志。没有输出或消息显示问题所在。
Visual studio contains the following components :-
Visual Studio包含以下组件: -
alt text http://ferdspics.googlepages.com/vs.JPG
替代文字http://ferdspics.googlepages.com/vs.JPG
Loads of forums mention debugging issues, but no simple solution were found.
大量的论坛提到了调试问题,但没有找到简单的解决方案。
Am I missing something ? Or does anyone know of a more concise site, that walks through successfull stored procedure debugging ?
我错过了什么吗?或者有没有人知道一个更简洁的网站,通过成功的存储过程调试?
6 个解决方案
#1
2
Check this, specially the remote debugging part: http://www.dbazine.com/sql/sql-articles/cook1
检查一下,特别是远程调试部分:http://www.dbazine.com/sql/sql-articles/cook1
For other general information on debugging sql check http://msdn.microsoft.com/en-us/library/zefbf0t6.aspx
有关调试sql的其他一般信息,请参阅http://msdn.microsoft.com/en-us/library/zefbf0t6.aspx
#2
2
Remember that you also have to have admin privileges on the sql server box that you're debugging on. In the past, I've had to use the RunAs option in the explorer context menu to start Visual Studio. I use the same credentials as the admin user on the sql server box.
请记住,您还必须在正在调试的sql server框上拥有管理员权限。过去,我必须使用资源管理器上下文菜单中的RunAs选项来启动Visual Studio。我使用与sql server框上的admin用户相同的凭据。
#3
1
Have you enabled SQL Server debugging in the project?
您是否在项目中启用了SQL Server调试?
Project | Properties | Debug tab.
项目|属性|调试选项卡。
EDIT: Can also enable "Allow SQL/CLR Debugging" on a data connection in the server explorer.
编辑:还可以在服务器资源管理器中的数据连接上启用“允许SQL / CLR调试”。
#4
1
One issue to investigate is that any SQL Server user account involved in SQL debugging must have "execute" rights on an extended stored procedure called sp_sdidebug, a right that only the system administrator account (sa) has by default.
需要调查的一个问题是,SQL调试中涉及的任何SQL Server用户帐户必须对名为sp_sdidebug的扩展存储过程具有“执行”权限,该权限仅默认为系统管理员帐户(sa)。
To check this, use the account to log into SQL Server and then type the following SQL command using SQL Server Management Studio:
要进行检查,请使用该帐户登录SQL Server,然后使用SQL Server Management Studio键入以下SQL命令:
EXEC master..sp_sdidebug
You’ll see either a result stating that the command completed successfully or an execute permission error. If you see the latter result, you should also check that the account has permission to the master database itself. It’s not unknown for a DBA to give permission to the stored procedure, but not to the master database.
您将看到结果表明命令已成功完成或执行权限错误。如果您看到后一个结果,则还应检查该帐户是否具有master数据库本身的权限。 DBA授予存储过程的权限,而不是master数据库的权限,这是未知的。
The quickest way to grant execution rights for a SQL Server account to sp_sdidebug is to enter the following SQL:
将SQL Server帐户的执行权限授予sp_sdidebug的最快方法是输入以下SQL:
GRANT EXECUTE ON master..sp_sdidebug TO SpecificAccountName
There's another issue, but it won't affect you as you're using Server Explorer. If you're debugging from a client application, you also have to execute the following command:
还有另一个问题,但在您使用服务器资源管理器时它不会影响您。如果从客户端应用程序进行调试,则还必须执行以下命令:
EXEC master..sp_sdidebug 'legacy_on'
Note that remote SQL Server debugging is done using the DCOM, and this can be tricky to configure properly. First, you need to install the full remote debugging components on the remote database server. You may also need to repeat this process every time the SQL Server is upgraded with a service pack or a patch.
请注意,远程SQL Server调试是使用DCOM完成的,这可能很难配置正确。首先,您需要在远程数据库服务器上安装完整的远程调试组件。每次使用Service Pack或修补程序升级SQL Server时,您可能还需要重复此过程。
#5
0
Have you tried debugging locally on the server via Citrix or RDP?
您是否尝试通过Citrix或RDP在服务器上进行本地调试?
Hope this helps,
希望这可以帮助,
Bill
#6
0
its the windows firewall. disable it and try it shall work
它的Windows防火墙。禁用它,尝试它应该工作
#1
2
Check this, specially the remote debugging part: http://www.dbazine.com/sql/sql-articles/cook1
检查一下,特别是远程调试部分:http://www.dbazine.com/sql/sql-articles/cook1
For other general information on debugging sql check http://msdn.microsoft.com/en-us/library/zefbf0t6.aspx
有关调试sql的其他一般信息,请参阅http://msdn.microsoft.com/en-us/library/zefbf0t6.aspx
#2
2
Remember that you also have to have admin privileges on the sql server box that you're debugging on. In the past, I've had to use the RunAs option in the explorer context menu to start Visual Studio. I use the same credentials as the admin user on the sql server box.
请记住,您还必须在正在调试的sql server框上拥有管理员权限。过去,我必须使用资源管理器上下文菜单中的RunAs选项来启动Visual Studio。我使用与sql server框上的admin用户相同的凭据。
#3
1
Have you enabled SQL Server debugging in the project?
您是否在项目中启用了SQL Server调试?
Project | Properties | Debug tab.
项目|属性|调试选项卡。
EDIT: Can also enable "Allow SQL/CLR Debugging" on a data connection in the server explorer.
编辑:还可以在服务器资源管理器中的数据连接上启用“允许SQL / CLR调试”。
#4
1
One issue to investigate is that any SQL Server user account involved in SQL debugging must have "execute" rights on an extended stored procedure called sp_sdidebug, a right that only the system administrator account (sa) has by default.
需要调查的一个问题是,SQL调试中涉及的任何SQL Server用户帐户必须对名为sp_sdidebug的扩展存储过程具有“执行”权限,该权限仅默认为系统管理员帐户(sa)。
To check this, use the account to log into SQL Server and then type the following SQL command using SQL Server Management Studio:
要进行检查,请使用该帐户登录SQL Server,然后使用SQL Server Management Studio键入以下SQL命令:
EXEC master..sp_sdidebug
You’ll see either a result stating that the command completed successfully or an execute permission error. If you see the latter result, you should also check that the account has permission to the master database itself. It’s not unknown for a DBA to give permission to the stored procedure, but not to the master database.
您将看到结果表明命令已成功完成或执行权限错误。如果您看到后一个结果,则还应检查该帐户是否具有master数据库本身的权限。 DBA授予存储过程的权限,而不是master数据库的权限,这是未知的。
The quickest way to grant execution rights for a SQL Server account to sp_sdidebug is to enter the following SQL:
将SQL Server帐户的执行权限授予sp_sdidebug的最快方法是输入以下SQL:
GRANT EXECUTE ON master..sp_sdidebug TO SpecificAccountName
There's another issue, but it won't affect you as you're using Server Explorer. If you're debugging from a client application, you also have to execute the following command:
还有另一个问题,但在您使用服务器资源管理器时它不会影响您。如果从客户端应用程序进行调试,则还必须执行以下命令:
EXEC master..sp_sdidebug 'legacy_on'
Note that remote SQL Server debugging is done using the DCOM, and this can be tricky to configure properly. First, you need to install the full remote debugging components on the remote database server. You may also need to repeat this process every time the SQL Server is upgraded with a service pack or a patch.
请注意,远程SQL Server调试是使用DCOM完成的,这可能很难配置正确。首先,您需要在远程数据库服务器上安装完整的远程调试组件。每次使用Service Pack或修补程序升级SQL Server时,您可能还需要重复此过程。
#5
0
Have you tried debugging locally on the server via Citrix or RDP?
您是否尝试通过Citrix或RDP在服务器上进行本地调试?
Hope this helps,
希望这可以帮助,
Bill
#6
0
its the windows firewall. disable it and try it shall work
它的Windows防火墙。禁用它,尝试它应该工作