The information in this article applies to:
SYMPTOMS
If a stored procedure contains an output parameter and either PRINT or
RAISERROR statements, the Microsoft SQL Server ODBC Driver may incorrectly
return the following SQLState:
MORE INFORMATIONThe ODBC driver raises the 07006 SQLState when it should be returning the output parameter, usually on the SQLFetch() or SQLExtendedFetch() for the final row of the last result set from the procedure. The output parameter value is not returned to the application. If the PRINT or RAISERROR is commented out, the driver will return the output parameter value at the correct time. The condition will not occur if there is only one PRINT statement and it is the first statement executed in the procedure. If there are multiple PRINT's, or it is not the first statement in the batch, the 07006 may be returned. STATUSMicrosoft has confirmed this to be a problem in the Microsoft SQL Server ODBC Driver version 2.50.0126. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available. WORKAROUNDReturn the output parameter as a regular select result set rather than an output parameter if the procedure contains either PRINT or RAISERROR statements. Additional query words: SQLExecDirect SQLExecute
Keywords : kbbug6.00 |
Last Reviewed: March 27, 1999 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |