Share via


Quick Methods for Using Location Breakpoints with SQL Source

Feature Only in Enterprise Edition   This feature is supported only in Visual C++ Enterprise Edition. For more information, see .

With the SQL debugger, you can set location breakpoints:

  • On a specific statement in SQL source code.

  • At the beginning or the return point of a nested stored procedure.

You can disable and enable breakpoints on a statement line or in the Call Stack window. You can set or remove any breakpoint by using either the Breakpoints dialog box or the following quick procedures.

To set a breakpoint at a statement or the Call Stack window

  1. In a source window, move the insertion point to the statement where you want the program to break.

  2. Click the Insert/Remove Breakpoint toolbar button.

    A red dot appears in the left margin, indicating the breakpoint is set.

    Note   If you want to set a breakpoint on a statement extending across two or more lines, you must set the breakpoint on the first line of the statement.

To set a breakpoint at the beginning of a stored procedure

  1. In the Find box on the Standard toolbar, type the stored procedure name.

  2. Click the Insert/Remove Breakpoint toolbar button.

    A red dot appears in the left margin at the beginning of the stored procedure, indicating that the breakpoint is set.

To disable a breakpoint

  1. In a source window, or in the Call Stack window, move the insertion point to the line containing the breakpoint you want to disable.

  2. Click the Enable/Disable Breakpoint toolbar button.

    The red dot in the left margin changes to a hollow circle.

To disable all breakpoints

  • Click the Disable All Breakpoints toolbar button.

    The red dots in the left margin change to hollow circles.

To enable a breakpoint

  1. In a source window, or in the Call Stack window, move the insertion point to the line containing the breakpoint you want to enable.

  2. Click the Enable/Disable Breakpoint toolbar button.

    The hollow circle in the left margin changes to a red dot.

Note   If you set more than one breakpoint on a line, and some breakpoints are disabled while others are enabled, a gray dot appears in the left margin to indicate multiple breakpoints with varying status. The first time you click the Enable/Disable Breakpoint toolbar button with the insertion point on that line, all breakpoints on the line become disabled, and the gray dot changes to a hollow circle. If you click the Enable/Disable Breakpoint button again, all breakpoints on the line become enabled, and the hollow circle changes to a red dot.

To remove a breakpoint using the Breakpoints dialog box

  1. In the Breakpoints dialog box, select a breakpoint in the Breakpoints list.

  2. Click Remove.

    The red dot in the left margin disappears.

To remove a breakpoint in a window

  1. In the source window or the Call Stack window, move the insertion point to the line containing the breakpoint you want to remove.

  2. Click the Insert/Remove Breakpoint toolbar button.

    The red dot in the left margin disappears.

Note   If a line contains enabled and disabled breakpoints, the Insert/Remove Breakpoint button removes all enabled breakpoints. Disabled breakpoints are not affected.