DEBUG a Stored Procedure. | SQL Server Performance Forums

SQL Server Performance Forum – Threads Archive

DEBUG a Stored Procedure.

Hi Gurus’
Can you pleas explain me How to Debug a Stored Procedure. Like, What I need to do to Debug a Stored Procedure. Please Explain. Thanks
raj
Hi raj,
In Query Analyser, Press F8 to show the object browser. Expand the DB that has the stored proc in it then expand the stored procedures. Right click on the one you want to debug and select debug. You will then be propted to enter values for the valiables in the procedure (From memory, you need to enter NULL for any OUTPUT variables). Use the Step into function to step through the proc and find any errors. You can also copy the code (everything after the AS), create valiables for the input/output and run it as a query. THis lets you put in PRINT commands to see what is happening Hope this helps! Ben
… and more about herehttp://www.15seconds.com/issue/050106.htm what Ben explained the process. Satya SKJ
Moderator
http://www.SQL-Server-Performance.Com/forum
This posting is provided “AS IS” with no rights for the sake of knowledge sharing.
]]>