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. 


3 comments:

  1. You have provided a nice article, Thank you very much for this one. And I hope this will be useful for many people. And I am waiting for your next post keep on updating these kinds of knowledgeable things
    SEO Training in Chennai
    SEO Course in Chennai
    Cloud Computing Training in Chennai
    Data Science Course in Chennai
    Devops Training in Chennai
    Digital Marketing Course in Chennai
    Selenium Training in Chennai
    SEO Training in Tnagar

    ReplyDelete
  2. Searching for a Digital Marketing SEO Course? Would you like to increase natural traffic on your website? Need to earn money through natural searches? Are you planning to begin your career as Digital Marketing freelancer? Learn advanced SEO (search engine optimization) in two weeks. No coding skills and technical knowledge is required. APTRON Gurgaon is here to solve every one of your disarrays regarding SEO.
    For More Info: SEO Course in Gurgaon

    ReplyDelete