How to: Enable SQL Debugging For a Project
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
The following procedure describes how to enable SQL Server debugging for a project that creates an application that calls SQL Server. This procedure is not required to do simple "Step into" debugging of individual database objects by means of Server Explorer, nor is it required for SQL Server projects.
When debugging against SQL Server 2000, this procedure will enable debugging for all servers and databases.
When debugging SQL Server 2005, you must also enable application debugging for the database connections you want to debug. This is enabled automatically when you set a breakpoint in a T-SQL object on the server, but automatic enabling may not be possible if you do not have a connection that uses Windows Authentication. For more information, see How to: Enable Multi-tier Debugging.
To debug SQL CLR database objects, you must have enabled CLR debugging for the selected database connection. This is enabled automatically if you set a breakpoint in a SQL CLR object. For more information, see How to: Enable CLR Debugging For a Connection.
You cannot step into your T-SQL or SQL CLR code from your application; you must set a breakpoint in the T-SQL or SQL CLR code you want to debug.
After installing SQL Server 2000 Service Pack 3.0, T-SQL debugging is turned off for earlier clients by default. For instructions on re-enabling T-SQL debugging, see the Knowledge Base article 328151: http://support.microsoft.com/default.aspx?scid=kb;en-us;328151.
The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.
To enable SQL debugging from a C++ project
In Solution Explorer, right-click and on the shortcut menu, click Properties.
In the <Project> Property Pages dialog box, open the Configuration Properties node, and select the Debugging node.
Set SQL Debugging to Yes.
To enable SQL Debugging for a Visual Basic or C# project
In Solution Explorer, select the project.
Right-click, and then click Properties.
The Property Pages dialog box appears.
Click the Debug tab.
In the Enable Debuggers section, select the SQL Server debugging check box.