Transact-SQL Database Debugging
This topic applies to:
Pro and Team
Does not apply
Command or commands hidden by default.
This section contains samples demonstrating debugging for all Transact
-SQL database object types.
In the past, Transact-SQL developers often wrote and debugged their Transact-SQL applications by using SQL Query Analyzer. Today, Query Analyzer has been replaced by the SQL Server Management Studio, which has no debugger. Transact-SQL developers now use the Visual Studio 2005 debugger instead.
Developers can also write their Transact-SQL applications in Visual Studio 2005, using a Database project. Whether you write your Transact
-SQL application in Visual Studio 2005 or not, debugging procedures are almost identical.
There are three debugging scenarios to consider:
Stepping into a Transact-SQL database object. For more information, see How to: Step into an Object Using Server Explorer.
Running a test script from the SQL Server Management Studio. For more information, see How to: Debug Transact-SQL Using the SQL Server Management Studio.
Running a test script from a Visual Studio 2005 Database project. For more information, see How to: Develop in Transact-SQL with the Database Project Type.
In order to debug a trigger, you must start your debugging session in a stored procedure. You cannot debug a stand-alone SQL script, have it fire a trigger, and be able to debug the trigger.