FIX: Binding a Variable to More Than One Output Parameter May Cause an Access Violation

This article was previously published under Q318171
This article has been archived. It is offered "as is" and will no longer be updated.
BUG #: 100768 (SQLBUG_70)
SYMPTOMS
If you bind a Transact-SQL local variable to more than one OUTPUT parameter for a stored procedure, the execution of the batch that includes the variable and stored procedure may fail with an access violation or may lead to an access violation for other SQL Server threads.
RESOLUTION
To resolve this problem, obtain the latest service pack for Microsoft SQL Server 7.0. For additional information, click the following article number to view the article in theMicrosoft Knowledge Base:
301511 INF: How to Obtain the Latest SQL Server 7.0 Service Pack
WORKAROUND
To work around this behavior, bind a local variable to only one unique OUTPUT parameter for a stored procedure execution.
STATUS
Microsoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was first corrected in Microsoft SQL Server 7.0 Service Pack 4.
MORE INFORMATION
The following Transact-SQL batch demonstrates an example of this problem:
DECLARE @x varchar(128)EXEC myproc @x output, @x outputselect @x				
An access violation may not occur with this general example. However, any batch and stored procedure execution that you develop in this fashion is subject to a possible access violation. Additionally, it may cause unpredictable problems in SQL Server that can lead to an access violation for other SQL Server threads.

There is no unique stack dump signature that you will see if an access violation occurs because of this problem. However, for reference, the following stack dump is an example of one you may see:

0x00426f59 Module(sqlservr+26f59) (CSsStr::LConvertToStr+4c)0x00427278 Module(sqlservr+27278) (CXVariant::ConvertToStr+429)0x0041b589 Module(sqlservr+1b589) (CXVariant::ConvertToTi+2a2)0x005327e6 Module(sqlservr+1327e6) (CParamExchange::ExtractOutParams+d40x00518c8c Module(sqlservr+118c8c) (CStmtExec::XretLocalExec+177)0x00518afa Module(sqlservr+118afa) (CStmtExec::XretExecute+253)0x004145f1 Module(sqlservr+145f1) (CMsqlExecContext::ExecuteStmts+11a)0x0041409f Module(sqlservr+1409f) (CMsqlExecContext::Execute+16a)				
Properties

Article ID: 318171 - Last Review: 10/24/2013 09:57:09 - Revision: 1.0

  • Microsoft SQL Server 7.0 Standard Edition
  • kbnosurvey kbarchive kbbug kbfix KB318171
Feedback