Pages

Wednesday, May 27, 2009

How to Debug TSQL Programs in SQL Server

Today I would like to give you simple tip to debug TSQL programs, which would save lot of time in fixing the problems. You don’t have to install any additional software; this option comes with SQL Server Management Studio.

>>>> Open and Login into SQL Server Management Studio (SSMS)
>>>> Choose the database in the Object Explorer
>>>> Click on New Query to open SQL Workspace
>>>> Expand Programmability/Stored Procedures.
>>>> Select the stored procedure to debug
>>>> Go to the Debug menu and click “Start Debugging”call the stored procedure from SQL Workspace(Refer to the below image)


>>>> Now press F11 by selecting Stored Procedure, this action triggers to the debugging mode.
>>>> Now Click F11 again to get inside the stored procedure
>>>> On the Locals Window you can see the values of the variables which are declared/used inside the stored procedure(Refer to below image)

3 comments:

Unknown said...

I am unable to find Debug menu.

Vijaya Kadiyala said...

Hi Sonu, This navigation is in 2008. Could you please tell me which version of SQL Server you are using....
Thanks -- Vijaya Kadiyala
www.DotNetVJ.com

Anonymous said...

The spell of "Memeber" should be "Member" on your page header :)