Pause on an error, fix it and retry
SQLTreeo T-SQL Debugger pauses a stored procedure on the statement that fails, before anything reacts. Fix the data or code, then retry, skip, or go back to BEGIN TRAN.
With Pause on errors switched on, SQLTreeo T-SQL Debugger stops on a failing statement before anything reacts to it, so you can fix the data or the code and go on. The status bar and the error bar name the error number, the line and the message.
What you can do at the error
- Fix the data in the query window, for example the row that caused a duplicate key, then press Retry to run the statement again.
- Fix the code in the procedure’s tab, then press Apply and Retry. The run continues with the new code.
- Skip the statement and continue with the next one.
- Back to BEGIN TRAN rolls back the open transaction and puts the procedures back where they were at their
BEGIN TRAN, with their variables as they were then. Use it to run the same part again with different data. - As SQL Server would lets the error take its normal course, as it would without the debugger.
If SQL Server has already rolled the transaction back, the debugger says so, and Back to BEGIN TRAN is still available.
For an example with a transaction that fails halfway, see Find the statement that fails in a stored procedure.
Stop the run
Stop (Shift+F5) ends the run and rolls back the transaction it has open.