How to: Develop in Transact-SQL with the Database Project Type
This topic applies to:
Edition |
Visual Basic |
C# |
C++ |
Web Developer |
---|---|---|---|---|
Express |
||||
Standard |
||||
Pro and Team |
Table legend:
Applies |
|
Does not apply |
|
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
Open Visual Studio and establish a connection to the database. For more information see How to: Connect to a Database.
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.
In Server Explorer, open the database object to be debugged and set breakpoints.
In the SQL Server Management Studio, run a script that will execute the database object.
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.
To finish debugging, press F5 or Start. The code will execute and exit the debugger.