The best tool for debugging Transact-SQL stored procedures comes right in the SQL Server box. Query Analyzer now includes a full-featured stored procedure debugger. You can set breakpoints, establish watches, and generally do what debuggers are designed to do—debug code. You can debug procedures from the current version of SQL Server back through SQL Server 6.5 Service Pack 2.

The interface by which this occurs is known as the SQL Server Debug Interface, or SDI for short. It was originally introduced with SQL Server 6.5 and has since been completely integrated with Visual Studio and, now, Query Analyzer.

Setup and Security Issues

You should run SQL Server under a user account, not the LocalSystem account, when debugging. Running under ...

Get Guru's Guide to SQL Server™ Stored Procedures, XML, and HTML, The now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.