Notice: This website is an unofficial Microsoft Knowledge Base (hereinafter KB) archive and is intended to provide a reliable access to deleted content from Microsoft KB. All KB articles are owned by Microsoft Corporation. Read full disclaimer for more details.

You receive a "Cannot debug stored procedures" error message when you try to debug a SQL Server stored procedure in Visual Studio 2005 or in Visual Studio .NET


View products that this article applies to.

Symptoms

You use Microsoft Windows Terminal Services to log on as a non-administrator to a computer that is running Microsoft Windows Server 2003. In the Windows Terminal Services session, when you use Microsoft Visual Studio 2005 or Microsoft Visual Studio .NET to try to debug a Microsoft SQL Server stored procedure that is on a remote computer, you may receive the following error message:
Cannot debug stored procedures because the SQL Server database is not setup correctly or user does not have permission to execute master.sp_sdidebug. Run SQL Server setup or contact database administrator.

↑ Back to the top


Workaround

To work around this problem, assign the SeCreateGlobalPrivelege user right to the Windows Server 2003 user account that you want to use to perform SQL debugging. To assign the SeCreateGlobalPrivelege user right to the user account, add the user account to the security setting for the Create global objects policy. To do this, follow these steps:
  1. Make sure that the user account is a member of the following groups:
    • Users
    • Remote Desktop Users
    • Debugger Users
    • VS Developers
  2. Add the user account to the security setting for the Create global objects policy. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Local Security Policy.
    2. In the left pane of the Local Security Settings console, expand Local Policies, and then click User Rights Assignment.
    3. In the right pane of the Local Security Settings console, right-click Create global objects, and then click Properties. The Create global objects Properties dialog box appears.
    4. Click Add User or Group. The Select Users or Groups dialog box appears.
    5. In the Enter the object names to select box, type the name of the user account, and then click OK.
    6. In the Create global objects Properties dialog box, click OK.
    7. On the File menu of the Local Security Settings console, click Exit.

↑ Back to the top


Status

This behavior is by design.

↑ Back to the top


More information

Steps to reproduce the behavior

  1. Use Windows Terminal Services to log on as a non-administrator to a computer that is running Windows Server 2003.
  2. Start Visual Studio 2005 or Visual Studio .NET.
  3. Make sure that an instance of SQL Server is running on a remote computer.
  4. In Visual Studio 2005 or in Visual Studio .NET, try to debug a SQL Server stored procedure that is on the remote computer.

↑ Back to the top


References

For more information, visit the following Microsoft Developer Network (MSDN) Web sites: For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
316549� How to debug stored procedures in Visual Studio .NET
815116� You cannot debug a SQL Server stored procedure in Visual Studio .NET
316569� FIX: Cannot step into stored procedure from ASP.NET code on Windows Server 2003
817178� Troubleshooting tips for T-SQL Debugger in Visual Studio .NET

↑ Back to the top


Keywords: kbvs2005swept, kbvs2005applies, kbsyssettings, kbsecurity, kbpolicy, kbuser, kbtsql, kbtermserv, kbstoredproc, kberrmsg, kbdebug, kbinterop, kbprb, KB836734

↑ Back to the top

Article Info
Article ID : 836734
Revision : 10
Created on : 11/27/2007
Published on : 11/27/2007
Exists online : False
Views : 401