Debugging Extended Procedures

You debug extended stored procedures the same way you debug any other DLL-based routine—by supplying a host application that loads the DLL and placing a breakpoint in the routine you wish to debug. In the case of extended procedures, the host application is SQL Server itself.

You can't debug extended procedures using the service version of SQL Server, so you have to use its console version instead. How do you start SQL Server as a console application? First, shut down the SQL Server service, then run sqlservr.exe (in the SQL Server BINN folder) directly and pass -c as a parameter. Additionally, if you wish to start a named instance of SQL Server, specify the -s command-line parameter and specify the name of the instance ...

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.