Click here to Skip to main content
Click here to Skip to main content

SQL Stored Procedure Debugging from SQL Query Analyzer

By , 21 Aug 2007
 

Introduction

Debug is the way to show your applications data flow or Execution flow

MS SQL Server 2000 provides to debug the stored procedures, Step by step debugging shows the flows of execution ponters.

Permissions and Security

system procedure sp_sdidebug provide to enable your debugging in yout T-SQL AQuery analyzer,
Before of debugging you need to ececute this system pocedure
sp_sdidebug 'LEGACY_ON' Same thing you can also off the debugging using this
sp_sdidebug 'LEGACY_OFF'Be careful that any other SQL permissions or authentication is still in effect or attempt to debug using a different user account than the actual bug demonstrates.

Debugging

Once you have the object browser tree view visible, select a stored procedure in a database and right-click on the stored procedure name. The right-click menu should have a 'debug' option at the very bottom.

If this Debug in menu option is not enabled then, you should review the permissions associated with your current user

Debug Procedure

Right click on the stored procedure name in the object browser tree view and choose 'debug'. This will bring up a 'Debug Procedure' window for you to enter initial values for any parameters

Same thing pass the value of second parameters then execute.

Summary

SQL Server 2000 Debugging is a huge step forward. You can have complex, nested code in stored procedures and be able to test them confidence regarding the statement of the database at each statement. This allows you to keep the transactional power and processing speed on the SQL server instead of trying to reinvent those features in the calling application.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Sarfraz Munna
Tester / Quality Assurance Fiserv
India India
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
GeneralMy vote of 2membergg673-Jul-09 5:49 
GeneralCannot reproduce as you instructmemberRicky Wang31-May-09 16:49 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Permalink | Advertise | Privacy | Mobile
Web04 | 2.6.130627.1 | Last Updated 22 Aug 2007
Article Copyright 2007 by Sarfraz Munna
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid