In SQL Server 2008, we can debug the procedure step by step. Place a break point by clicking on the left hand side of your query window. A dot will come, which indicates the control will stop at this point. From there, we are allowed to debug the procedure.
We have been provided with quick watch/Add watch options to monitor the value of a variable in the procedure.
Steps for debugging:Press Alt+f5 or goto Debug option and click "Start debugging". If you are familiar with Visual studio then its too handy to debug in SSMS. F11 to go each and every step inside the function. Where as F10 will jump to the next line control.
How about in SQL Server 2005. Do we have any option to debug a procedure in SQL Server 2005?
SSMS doesn't have an option to debug the procedure but this can be achieved using Visual studio.
Goto Tools -> Connect to Database -> You will get Data connections -> right click it and select Add Connection -> Provide your server, appropriate database and credentials to connect.
Your database will be displayed. Goto ->Stored Procedure and select your stored proc.
Right click -> Step into Stored Procedure -> Your debug window will open.
Provide necessary inputs and you can start debugging your stored procedure
You can see your procedure running in the debug mode.
Cheers,
Venkatesan Prabu .J
No comments:
Post a Comment