Microsoft KB Archive/166110

From BetaArchive Wiki

Article ID: 166110

Article Last Modified on 10/15/2002



APPLIES TO

  • Microsoft Visual C++ 5.0 Enterprise Edition



This article was previously published under Q166110

SYMPTOMS

While using the SQL Debugger to debug a Trigger, the debugger doesn't break on each breakpoint that you have set.

CAUSE

The SQL Debugger allows you to set breakpoints on any line of code inside a Trigger regardless of whether it is a valid line of code.

RESOLUTION

The breakpoints that the debugger skips are placed on invalid lines of code.

To avoid this issue, place breakpoints on valid debuggable lines of SQL code only.

STATUS

Microsoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was corrected in Visual C++ version 6.0 for Windows.

MORE INFORMATION

This bug only pertains to Triggers. While debugging a Stored Procedure, the debugger only allows you to set breakpoints on valid lines of code. If you try to set a breakpoint on an invalid line of code while debugging a stored procedure, the breakpoint is moved to the next valid debuggable line of SQL code.

When you are using a stored procedure and setting breakpoints before you start debugging, you can set breakpoints anywhere in the code including non-debuggable statements. However, as soon as you start debugging, you receive the following warning and breakpoints are moved:

   One or more breakpoints are not positioned on valid lines.
   These breakpoints have been moved to the next valid lines.
                

When you are using a trigger and setting breakpoints before you start debugging, you can set breakpoints anywhere in the code including non- debuggable statements. The warning listed above is not shown and invalid breakpoints are not removed during debugging.

Sample Code

   CREATE TRIGGER MyTrigger
   ON authors
   FOR DELETE
   AS

   /* Can set a breakpoint on the DECLARE line however since this isn't a
   valid debuggable line the debugger will skip over it and stop on the
   SELECT line */ 

      DECLARE  @charVar CHAR

      SELECT * FROM Authors
                


Additional query words: kbvc500bug kbvc600fix kbEEdition kbSQL kbDebug kbtools

Keywords: kbbug kbfix kbvc600fix kbeedition KB166110