Debugging Stored Procedures

Debugging Stored Procedures

You will learn

In the following exercise we will show how to debug a procedure using the SQLScript debugger. This includes setting breakpoints, evaluating expressions and intermediate results.Please note - This tutorial is based on SPS11

Details

Step 1: Start the debugger

Go to the HRTT page and open the procedure called dev602.procedures::get_po_header_data.

Execution of the procedure has started, and a debugger pane is now visible which is displayed on the right. You can see all of the variables and parameters for this procedure. You might notice that this pane is currently not showing the intermediate table variables at this point.

You will notice that execution has continued to the next statement. In the debugger pane, a new local variable has been added. This is because it is not defined explicitly will be implicitly declared at runtime during first usage.

To see the data for this intermediate table variable, right click on it and choose “Display Content”.

A new window is then opened showing the data in the table. Review the data and close the window by clicking the “X” in the upper right hand corner.

Once again click the Step Over button. Notice the next intermediate table variables is also added. You can review the data in this table as well.

Continue to step through the code and when execution stops at the END statement of the procedure, display the contents of the output parameter the same way you did for the intermediate table variables. Finally, close the window by clicking the “X”.