Specify a breakpoint condition
Applies to: SQL Server
A breakpoint condition is a Transact-SQL expression that the debugger evaluates when the breakpoint is reached. If the condition is satisfied and any specified hit count reached, the debugger either breaks or performs the action specified for the breakpoint.
Specifying conditions
The expression specified must be a valid Transact-SQL expression that evaluates to a Boolean value. For more information, see Expressions (Transact-SQL).
If you specify a breakpoint condition with invalid syntax, a warning message appears immediately. If you specify a condition with valid syntax but invalid semantics, a warning message is displayed the first time the breakpoint is hit. In either case, the debugger breaks execution when the invalid breakpoint is hit.
Specify a condition
In the editor window, right-click the breakpoint glyph, and then select Conditions... on the shortcut menu.
-or-
In the Breakpoints window, right-click the breakpoint glyph, and then select Settings on the shortcut menu.
In the Breakpoint Settings dialog box, select the Conditions option and select Conditional Expression from the drop-down.
Enter a valid Boolean expression for the Conditional Expression.
Select Is true if you want to break when the expression evaluates to true, or select When changed if you want to break when the value of the expression changes.
Note
The debugger does not evaluate the Boolean expression until the first time the breakpoint is reached. If you choose When changed, the debugger does not consider the first evaluation to be a change, so the debugger will not break on the first evaluation.