Share via


How to: Enable Transact-SQL Debugging For a C++, Visual Basic, or C# Project

This topic applies to:

Visual Studio Ultimate

Visual Studio Premium

Visual Studio Professional

Visual Studio Express

ms165038.DoesApplybmp(en-us,VS.100).gif ms165038.DoesApplybmp(en-us,VS.100).gif ms165038.DoesApplybmp(en-us,VS.100).gif ms165038.DoesNotApplybmp(en-us,VS.100).gif

The following procedure describes how to enable Transact-SQL debugging for a C++, Visual Basic, or C# project that creates an application that calls SQL Server or later.

Note

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 Transact-SQL in a C++, Visual Basic, or C# project, you must enable application debugging for the database connections you want to debug. This is enabled automatically when you set a breakpoint in a Transact-SQL database 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.

You cannot step into your Transact-SQL code from your application; you must set a breakpoint in the Transact-SQL code you want to debug.

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 the project and then click Properties. The Property Pages dialog box appears.

  3. Click the Debug tab.

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

See Also

Other Resources

Setting Up Transact-SQL Debugging