从Visual Studio调试SQL Server 2005中的存储过程? [英] Debugging stored procedure in SQL Server 2005 from Visual Studio?

查看:127
本文介绍了从Visual Studio调试SQL Server 2005中的存储过程?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在这里和其他地方,我看到很多沮丧的问题,没有明确的答案。我正在尝试对存储的proc进行调试,但是没有成功。

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.

客户端:VS2005或VS2008,两者都不起作用。当我从sproc上下文菜单中选择进入存储过程时,在调试窗口中显示被用户取消,这就是结束了。

Client: either VS2005 or VS2008, works in neither. 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.

以下内容可以帮助自己(全部无济于事):

I did the following to help myself (all to no avail):


  1. 右键单击连接,然后选择应用程序调试和允许SQL / CRL调试

  2. 请确保所有框都在同一域中。

  3. 请确保我以相同的身份登录到SQL Server我用来登录工作站的域帐户。

  4. 请确保我的域帐户既是SQL框中的管理员,也是SQL Server中的管理员。

  5. 我在SQL框上运行了msvsmon.exe,并成功从客户端框(在VS中)将其附加到进程。

  1. Right clicked on the connection and selected 'Application Debugging' and 'Allow SQL/CRL debugging'
  2. Made sure that all the boxes are on the same domain.
  3. Made sure that I am logging in to SQL Server with the same domain account that I log into my workstation with.
  4. Made sure that my domain account is both an admin on the SQL box and an admin within SQL Server.
  5. I ran msvsmon.exe on the SQL box and successfully attached to a process from my client box (in VS).

我缺少什么?

推荐答案

此处的一个重要问题是,如果SQL Server进程作为本地系统运行,则此方法将不起作用,这是默认安装。以本地计算机管理员组中的帐户运行。

One important issue here is that this won't work if SQL Server process is running as local system, which is the default install. It needs to be running as an account which is in the administrator group on the local machine.

我要做的是在名为 sqlserver的框中设置本地用户,并将其放入本地管理员组。然后,进入服务控制面板,停止sql server服务。对其进行修改并将其设置为以指定的用户帐户而不是本地系统运行。指定sqlserver本地用户帐户和您创建的密码。然后重新启动服务。

What I have done is set up local user on my box named "sqlserver" and put it into the local administrators group. Then, go into the service control panel, stop the sql server service. 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. Then restart the service.

这篇关于从Visual Studio调试SQL Server 2005中的存储过程?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆