BUG: SQLState 07006 if Procedure Returns an Output ParameterLast reviewed: May 5, 1997Article ID: Q152173 |
The information in this article applies to:
SYMPTOMSIf 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:
SQLState = 07006, pfNative = 0 szErrorMsg = '[Microsoft][ODBC SQL Server Driver] Restricted data type attribute violation.' 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
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |