INF: How to Debug an Extended Stored Procedure

Last reviewed: April 9, 1997
Article ID: Q156099

The information in this article applies to:
  • Microsoft SQL Server, version 6.5

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


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 9, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.