| title | Specify a Hit Count | |
|---|---|---|
| titleSuffix | T-SQL debugger | |
| ms.prod | sql | |
| ms.technology | scripting | |
| ms.topic | conceptual | |
| f1_keywords |
|
|
| helpviewer_keywords |
|
|
| ms.assetid | 24836939-94ed-4e57-aa85-5d6938d859e4 | |
| author | markingmyname | |
| ms.author | maghan | |
| ms.reviewer | ||
| ms.custom | seo-lt-2019 | |
| ms.date | 12/04/2019 | |
| monikerRange | >=aps-pdw-2016||=azuresqldb-current||=azure-sqldw-latest||>=sql-server-2016||=sqlallproducts-allversions||>=sql-server-linux-2017||=azuresqldb-mi-current |
[!INCLUDEappliesto-ss-xxxx-xxxx-xxx-md]
A breakpoint hit count is a counter that is incremented by the [!INCLUDEtsql] debugger each time the breakpoint is reached. If the specified hit count is reached and any specified breakpoint condition is satisfied, the debugger performs the action specified for the breakpoint.
[!INCLUDEssms-old-versions]
By default, execution breaks every time a breakpoint is hit. You can choose between the following options:
-
Break always (the default).
-
Break when the hit count equals a specified value.
-
Break when the hit count equals a multiple of a specified value.
-
Break when the hit count is greater than or equal to a specified value.
Breakpoint hit counts are incremented within the scope of a debugging session. All hit counts are set to zero at the start of each debugging session.
If you want to track how many times a breakpoint is hit without having the breakpoint break execution, specify a hit count with a very high value so the breakpoint never breaks.
The default action for a breakpoint is to break execution when both the hit count and breakpoint condition have been satisfied. For information about specifying other actions, see Specify a Breakpoint Action.
-
In the editor window, right-click the breakpoint glyph, and then click Hit Count on the shortcut menu.
-or-
In the Breakpoints window, right-click the breakpoint glyph, and then click Hit Count on the shortcut menu.
-
In the Breakpoint Hit Count dialog box, select the behavior you want from the When the breakpoint is hit box.
If you choose any setting other than Break Always, a text box appears to the right of the list. Enter an integer in the text box to specify the hit count you want.
-
Click OK to implement the changes, or Cancel to exit without applying the changes.
-
In the editor window, right-click the breakpoint glyph, and then click Hit Count on the shortcut menu.
-or-
In the Breakpoints window, right-click the breakpoint glyph, and then click Hit Count on the shortcut menu.
-
In the Breakpoint Hit Count dialog box, the Current hit count: is displayed just above the Reset button.
-
Click Reset if you want to set the current hit count to zero.
-
Click OK or Cancel to exit the dialog.