Microsoft KB Archive/836734

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

Article ID: 836734

Article Last Modified on 11/27/2007

-

APPLIES TO


 * Microsoft Visual Studio 2005 Standard Edition
 * Microsoft Visual Studio 2005 Professional Edition
 * Microsoft Visual Studio .NET 2003 Professional Edition
 * Microsoft Visual Studio .NET 2003 Enterprise Architect
 * Microsoft Visual Studio .NET 2003 Enterprise Developer
 * Microsoft Visual Studio .NET 2003 Academic Edition
 * Microsoft Visual Studio .NET 2002 Professional Edition
 * Microsoft Visual Studio .NET 2002 Enterprise Architect
 * Microsoft Visual Studio .NET 2002 Enterprise Developer
 * Microsoft Visual Studio .NET 2002 Academic Edition, when used with:
 * Microsoft Windows Server 2003, Enterprise Edition (32-bit x86)
 * Microsoft Visual Basic 2005

-





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.



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:  Make sure that the user account is a member of the following groups:  Users Remote Desktop Users Debugger Users VS Developers  Add the user account to the security setting for the Create global objects policy. To do this, follow these steps: <ol style="list-style-type: lower-alpha;"> Click Start, point to Administrative Tools, and then click Local Security Policy.</li> In the left pane of the Local Security Settings console, expand Local Policies, and then click User Rights Assignment.</li> 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.</li> Click Add User or Group. The Select Users or Groups dialog box appears.</li> In the Enter the object names to select box, type the name of the user account, and then click OK.</li> In the Create global objects Properties dialog box, click OK.</li> On the File menu of the Local Security Settings console, click Exit.</li></ol> </li></ol>

<div class="status_section">

STATUS
This behavior is by design.

<div class="moreinformation_section">

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.

<div class="references_section">