Mar 8, 2014

How to debug sql queries in SSMS (Sql server management studio)


How to debug sql queries in SSMS (Sql server management studio)

To debug a sql query in SSMS (sql sever management studio 2008 r2) 

Step 1: Add breakpoints in your query page of SSMS. For this click on left side bar as shown in following screen by red oval.


Step 2: Click on debug button or press Alt + F5. Debug button has shown in following screen by red oval:

Step3: To go next lines: 

Key     Meaning
F10  It is also called step over. It goes to next step but if query executes functions or stored procedures control will 

not go to inside function or stored procedure.

F11 It is also called step into.  It goes to next step but if query executes functions or stored procedures control will go 

to inside function or stored procedure. 

Alt + F5: It is called continue. If sql quires has more than breakpoints then control will move from one breakpoints to 

other directly and if no breakpoints then control move to end of the sql query.

Following figure shows continue,step over and step into buttons in ssms:

Step : Repeat the step 3 to go to the next steps. To know the current value of any local variables, put mouse over on that variable as shown in the following figure. Also at bottom in the Locals window you can get values and data type of the local variable. 


8 comments:

Mehak Shaikh said...

c

Nina Athena said...

Thank you for sharing this! What you have shared is very helpful and informative. Would love to see more updates from you.

Melbourne Web Designer

dhishageetha said...

Amazing Post. keep update more information.
Aviation Academy in Chennai
Air Hostess Training in Chennai
Airport Management Courses in Chennai
Ground Staff Training in Chennai
Aviation Courses in Chennai
Air Hostess Training Institute in Chennai
Airline Courses in Chennai
Airport Ground Staff Training in Chennai

13IT Australia said...

Thanks for sharing information. Choosing computer accessories from leading IT store offer great discount and value for your money Computer Store Australia | All in One Pc Australia

Andre Schroeder said...

It’s an excellent platform concerning at least one of our primary problems! First I noticed them on the make money online , and after linking to them I used to be surely comfortable! encouraged to all!

Mary Schmitz said...

I was getting bore since morning but as soon as I got this link & reached at this blog, I turned into fresh and also joyful too.
100K Blueprint 4

Robet John said...

Quickly this site will indisputably be famous among all blogging people, because of its fastidious articles or reviews.
design firms in san francisco

Salk Jons said...

Your write-ups are far more than wow!
100K Blueprint