INF: How to Debug an Extended Stored Procedure

ID: Q156099


The information in this article applies to:


SUMMARY

This article describes the steps to properly debug an extended stored procedure.


MORE INFORMATION

  1. Make a debug build of the extended stored procedure DLL with Visual C. Make sure to generate the PDB file.


  2. Once the DLL is properly built, copy it to the c:\Mssql\Binn directory. The DLL being loaded by SQL Server and the PDB must be in sync to properly handle breakpoints.


  3. Add the following to the Project Settings\Debug tab.
    
         Executable for debug session: C:\MSSQL\BINN\SQLSERVR.EXE
         Program arguments: -c
     
    This will start the SQL Server not as a service but under the control of the Visual C Debug environment. This will allow your breakpoints to be properly trapped and handled.


  4. Stop SQL Server if it is currently running by opening the Services tool in Control Panel and stopping the MSSQLSERVER service.


  5. Set your breakpoint and begin the debugging session.


  6. Once SQL Server is properly started and the cursor returns to a blinking state in the SQL Server command prompt window, minimize the window.


  7. Execute the extended stored procedure.


When the breakpoint is encountered the MSDEV environment will stop and you can begin normal debugging.

Additional query words: ODS


Keywords          : kbnetwork SSrvODS SSrvStProc 
Version           : 6.5
Platform          : WINDOWS 
Issue type        : 

Last Reviewed: April 1, 1999