This topic explains how to debug SQL scripts using the Debugger.
Note
To debug a SQL script, you don’t need any special privileges, except for the privileges required for execution of the script statements.
To debug a SQL script:
1. In the SQL Editor, open the script you want to debug.
2. On the top menu, select Debug > Start.
3. To set a breakpoint for your statement, click in the gray margin next to the SET statement.
Warning
If a statement is invalid, an error message appears in the error list, though the debugging process continues.
4. To suspend the debugging of a SQL script, on the Debug toolbar, click
.
5. To trace a SQL script, use the different step commands of the top Debug menu.
If a SQL script includes a call to another script using the SOURCE command, you can use Step Into to enter the called script during debugging. If the called script contains breakpoints, execution will pause at those breakpoints.
The Call Stack pane displays the sequence of script calls, showing the current execution path.
You can use the Watches pane to view server and session variables during SQL script debugging.
6. To stop the debugging process, on the Debug toolbar, click
.