Click to Rate and Give Feedback
MSDN
MSDN Library
Visual Studio 2005
Visual Studio
Accessing Data
 How to: Use Breakpoints With Stored...

  Switch on low bandwidth view
This page is specific to
Microsoft Visual Studio 2005/.NET Framework 2.0

Other versions are also available for the following:
Visual Database Tools 
How to: Use Breakpoints With Stored Procedures, User-Defined Functions, and Triggers 

You can debug Microsoft SQL Server stored procedures, user-defined functions, and triggers using breakpoints in much the same way that you debug other kinds of scripts or program source code.

When you are debugging an SQL routine, the breakpoints are actually stored within the solution file. If you want to close and then re-open the integrated development environment with the same breakpoints, you must re-open the same solution that was open when you previously debugged and saved the SQL routine.

Following are the most common procedures for using breakpoints with Microsoft SQL Server.

NoteNote

The dialog boxes and menu commands you see might differ from those described in Help depending on your active settings or edition. To change your settings, choose Import and Export Settings on the Tools menu. For more information, see Visual Studio Settings.

To open a stored procedure, user-defined function, or trigger

  1. Make a connection to a database.

  2. Right-click the stored procedure, user-defined function, or trigger you want to work with and choose Open from the shortcut menu.

    This opens the SQL routine in the editor window.

To insert a breakpoint

  1. Right-click the line of SQL syntax in the editor window where you want to insert a breakpoint.

  2. Point to Breakpoint and then click Insert Breakpoint.

You can modify which breakpoints are active by either removing or disabling existing breakpoints. You can also clear all breakpoints and modify breakpoint properties.

To remove a breakpoint

  1. Position the cursor on the line of SQL syntax that contains the breakpoint.

  2. Right-click, point to Breakpoint, and then click Remove Breakpoint.

To disable a breakpoint

  1. Position the cursor on the line of SQL syntax that contains the breakpoint.

  2. Right-click, point to Breakpoint, and then click Disable Breakpoint.

To delete or disable all breakpoints

  1. Position the cursor on the line of SQL syntax that contains the breakpoint.

  2. From the Debug menu, click Delete All Breakpoints or Disable All Breakpoints.

To change breakpoint properties

  1. Position the cursor on the line of SQL syntax that contains the breakpoint.

  2. Right-click, point to Breakpoint, and then click the property you want to modify. The options are Location, Condition, Hit Count, Filter, and When Hit.

See Also

Tags What's this?: Add a tag
Community Content   What is Community Content?
Add new content RSS  Annotations
Processing
© 2009 Microsoft Corporation. All rights reserved. Terms of Use  |  Trademarks  |  Privacy Statement
Page view tracker