How to debug a SQL script

This topic explains how to debug SQL scripts using debugger integrated into dbForge Studio for SQL Server.

To debug an SQL script:

  1. Open the required script in the SQL editor.

  2. On the Debug menu, click Start.

  3. You can set a breakpoint on any line of executable code.

If a statement is invalid, an error message appears in the error list, though debugging process continues. The debugging of an SQL script can be suspended by clicking the Pause command. You can also use different step commands of the Debug menu to trace an SQL script.

To debug an SQL script, you don’t need any special privileges, except for the privileges, required for execution of the script statements.

If an SQL script contains call of another script with SOURCE command, you can use the Step Into command to step into the called script. If this script contains breakpoints, execution stops on these breakpoints. The Call Stack window shows stack of the script calls.

You can use the Watches window to view server and session variables during SQL script debugging.

Want to Find out More?

Overview

Overview

Take a quick tour to learn all about the key benefits delivered by dbForge Studio for SQL Server.
All Features

All features

Get acquainted with the rich features and capabilities of the Studio in less than 5 minutes.
Request a demo

Request a demo

If you consider employing the Studio for your business, request a demo to see it in action.
Ready to start using dbForge Studio for SQL Server?