How to: Enable SQL Debugging For a Project

This topic applies to:

Edition

Visual Basic

C#

C++

Web Developer

Express

Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Standard

Topic does not apply Topic does not apply Topic does not apply Topic does not apply

Pro and Team

Topic applies Topic applies Topic applies Topic applies

Table legend:

Topic applies

Applies

Topic does not apply

Does not apply

Topic applies but command hidden by default

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.

Note

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: https://support.microsoft.com/default.aspx?scid=kb;en-us;328151.

Note

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

  1. In Solution Explorer, right-click and on the shortcut menu, click Properties.

  2. In the <Project> Property Pages dialog box, open the Configuration Properties node, and select the Debugging node.

  3. Set SQL Debugging to Yes.

To enable SQL Debugging for a Visual Basic or C# project

  1. In Solution Explorer, select the project.

  2. Right-click, and then click Properties.

    The Property Pages dialog box appears.

  3. Click the Debug tab.

  4. In the Enable Debuggers section, select the SQL Server debugging check box.

See Also

Other Resources

Setting Up SQL Debugging