FIX: Changes Lost When Changing Variable During DebuggingLast reviewed: September 19, 1997Article ID: Q157903 |
The information in this article applies to:
SYMPTOMSWhen you debug a SQL Server-stored procedure, if you change a variable or parameter to a value that is longer than the declared size of the variable or parameter, your changes will be lost without warning in the next step of the debugger.
CAUSEDeveloper Studio accumulates all changes made to variables and parameters and then ships them across to SQL Server when the user moves to the next step. SQL Server may either accept or reject the changes. In this case, it rejects because of buffer overflow. MSDEV shows the valid values of the variables in the next step and ignores the invalid assignment that the user specified.
RESOLUTIONSQL Server will only accept changes that satisfy the declaration of the variable or parameter. MSDEV does not impose this limitation on values entered in the debugger. Therefore, just because the MSDEV accepted a value for a variable or parameter, do not conclude that that value will necessarily be the one that is used thereafter in the execution of the stored procedure. The deciding factor is whether SQL Server accepts the new value.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This bug was corrected in Visual C++, Enterprise Edition, version 5.0.
MORE INFORMATIONAs an example of this behavior, if you have the following variable declaration in your stored procedure:
declare @name varchar(10) select @name = 'Value'and you change "@name" to a value that is longer than 10 characters (using the watch window) while debugging, the changes will be accepted and MSDEV will show the new value in the watch window. However, as soon as you step to the next statement, "@name" will revert to the value it had before you changed it.
Keywords : vcbuglist420 VCEntIDE VCEntIss VCEntSQLDebug vcfixlist500 kbprg kbbuglist kbfixlist Technology : kbMfc Version : 4.2 Platform : NT WINDOWS Issue type : kbbug Solution Type : kbfix |
================================================================================
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |