This documentation is archived and is not being maintained.

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

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