How to debug a SQL script
Last modified: December 30, 2022
To debug a SQL script:
1. Open the required script in the SQL editor.
2. Set a breakpoint for your statement by clicking in the gray margin next to the SET statement.
3. In the Debug menu, click Start.
If a statement is invalid, an error message appears in the error list, though the debugging process continues. The debugging of a SQL script can be suspended by clicking the Stop button. You can also use different step commands of the Debug menu to trace a SQL script.
To debug a SQL script, you don’t need any special privileges, except for the privileges, required for the execution of the script statements.
If a SQL script contains a call of another script with SOURCE command, you can use the Step Into command to step into the script being called. If this script contains breakpoints, execution stops on these breakpoints. The Call Stack window shows the stack of the script calls.
You can use the Watches window to view server and session variables during SQL script debugging.