Click here to Skip to main content
Licence CPOL
First Posted 21 Aug 2007
Views 25,743
Bookmarked 21 times

SQL Stored Procedure Debugging from SQL Query Analyzer

By | 21 Aug 2007 | Article
Debugging a SQL Stored Procedure in SQL Server 2000 Query Analyzer
 
Part of The SQL Zone sponsored by
See Also

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

Member



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

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralMy vote of 2 Pinmembergg675:49 3 Jul '09  
GeneralCannot reproduce as you instruct PinmemberRicky Wang16:49 31 May '09  

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

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

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