How to: Develop in Transact-SQL with the Database Project Type

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.

You can code, deploy, test, and debug a T-SQL database object inside a Visual Studio Database project type.

To run a test script in a Visual Studio Database project

  1. Open Visual Studio and establish a connection to the database. For more information see How to: Connect to a Database.

  2. You can modify objects by double-clicking on them in Server Explorer to open them, making any changes, and then saving them. The save operation compiles them on the server instead of writing to a local file.

  3. In Server Explorer, open the database object to be debugged and set breakpoints.

  4. In the SQL Server Management Studio, run a script that will execute the database object.

  5. The code for the object will appear, with a yellow arrow in the left gray margin indicating the statement about to be executed. You may now use most of the familiar debugger features.

  6. To finish debugging, press F5 or Start. The code will execute and exit the debugger.

See Also

Other Resources

Common Procedure Reference