BUG: Stored Procedures May Retain Variable Value Between Executions (278486)
The information in this article applies to:
- Microsoft SQL Server 2000 (all editions)
This article was previously published under Q278486
BUG #: 350858 (SHILOH)
SYMPTOMS
In a stored procedure that accepts parameters, if one of the parameters defaults to the value of another parameter, the parameter with the default may retain its value from the previous execution of the stored procedure, instead of being reset to the default.
WORKAROUND
To work around this problem, do one of the following:
- Supply values for all parameters.
- Use the WITH RECOMPILE option when you create the stored procedure.
- Set that parameter's default value to a value that it will never hold, perhaps NULL, and test it in the stored procedure. If that parameter's value is equal to the default, change it to be equal to the parameter that was used as the default in the original stored procedure.
STATUS
Microsoft has confirmed this to be a problem in SQL Server 2000.
Modification Type: | Major | Last Reviewed: | 10/16/2003 |
---|
Keywords: | kbbug kbpending kbSQLServ2000sp1fix KB278486 |
---|
|