This example demonstrates how to debug Microsoft SQL Server stored procedure by stepping into the stored procedure. It also illustrates different debugging techniques such as setting breakpoints, viewing data items, and so on.
In this topic, some sample database objects are used for demonstrating how to work with the dbForge Fusion for SQL Server Debugger. Use scripts specified in this topic to create necessary objects in your test database.
Use the script below to create the procedure that takes two input parameters: DateFrom and DateTo. Based on these input parameters the table fills up with data.
Assume that you need to get Time Sheet for a specific time period. To do this, execute the FillSchedule procedure:
Enter input parameters.
Note
Actual document look may slightly vary from the above image depending on the product you use.
A quick look through the code gives you nothing and you have no other choice but to start the debugger.
To start debugging the stored procedure:
Enter the stored procedure input parameters once again and click OK.
You can see that the yellow arrow identifies the stack frame where the execution pointer is currently located.
Click Retrieve Data on the shortcut menu.
dbForge Fusion for SQL Server displays the result table.
As you see, the Debugger for Microsoft SQL Server is a very simple and powerful tool to use. You can use different debugging techniques to achieve successful results.