[英]Debugging stored procedure in SQL Server 2005 from Visual Studio?
I see a lot of frustrated questions here and elsewhere with no clear answer. 我在这里和其他地方看到了许多令人沮丧的问题,没有明确的答案。 I am trying to get the stored procs to debug, but with no success. 我试图让存储过程调试,但没有成功。
Client: either VS2005 or VS2008, works in neither. 客户端:VS2005或VS2008,两者都不兼容。 When I select 'Step into Stored Procedure' from the sproc context menu, I get "Cancelled by User' in the debug window and that's the end of it. 当我从sproc上下文菜单中选择“Step into Stored Procedure”时,我在调试窗口中得到“User by User”,这就是它的结束。
I did the following to help myself (all to no avail): 我做了以下事情来帮助自己(一切都无济于事):
What am I missing? 我错过了什么?
One important issue here is that this won't work if SQL Server process is running as local system, which is the default install. 这里的一个重要问题是,如果SQL Server进程作为本地系统运行,这将是无效的,这是默认安装。 It needs to be running as an account which is in the administrator group on the local machine. 它需要作为本地计算机上的管理员组中的帐户运行。
What I have done is set up local user on my box named "sqlserver" and put it into the local administrators group. 我所做的是在名为“sqlserver”的盒子上设置本地用户并将其放入本地管理员组。 Then, go into the service control panel, stop the sql server service. 然后,进入服务控制面板,停止sql server服务。 Modify it and set it to run as the specified user account rather than as local system. 修改它并将其设置为以指定的用户帐户而不是本地系统运行。 Specify the sqlserver local user account and the password you created. 指定sqlserver本地用户帐户和您创建的密码。 Then restart the service. 然后重启服务。
What edition is your SQL Server? 你的SQL Server是什么版本的? SP debugging is only available in Pro and Team edition (not Express and Standard) SP调试仅适用于Pro和Team版本(不是Express和Standard)
Also make sure (again) you're using Windows authentication to login and your account is a sysadmin in SQL server. 还要确保(再次)使用Windows身份验证登录,并且您的帐户是SQL Server中的sysadmin。
As you are able to attach to a process on the SQL box, I assume DCOM to work correctly and there is no blocking firewall in between. 由于您可以附加到SQL框上的进程,因此我假设DCOM正常工作,并且两者之间没有阻塞防火墙。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.