Debug StoreProcedure from SqlServer Management

0

Good day everyone today I have a question since I have never used the sql server management debugger and I need debugge a stored procedure in which I make several insert to different tables and when executing it for a single record it stays cycled.

If someone could advise me how to perform the debuggeo step by step, I would appreciate it a lot since I do not know how to do it and it is a very important tool.

Greetings and thanks again to everyone.

    
asked by Alberto Arenas 04.04.2017 в 17:26
source

1 answer

2

The short form:

  • Open a new window, write the execution of the stored procedure, for example assuming that your procedure is called ObtieneUsuarios :

    EXEC ObtieneUsuarios
    
  • Position the cursor and type F9 , this to put a breakpoint.

  • Click the ► Debug button, or if necessary, ALT + F5

  • The debug process will begin and now the text EXEC ObtieneUsuarios is shaded in yellow.

  • To enter to debug Stored Procedure F11

  • The debugger will enter the Stored Procedure , to go step by step you will have to type F10

  • To run the execution it will be again with ALT + F5

  • You can put the breakpoints you want, but when you let run the execution with the instruction of point 7, the debugger will stop right where you find the next breakpoint.

  • To exit the debugging mode, it will be necessary to finish the execution of the Stored Procedure , or in your case click on the stop button by pressing ■

  • The long form, you can find it in the official documentation .

        
    answered by 12.04.2017 / 19:01
    source