INF: Interpreting Return Status Values from Stored Procedures

Last reviewed: April 3, 1997
Article ID: Q96237

The information in this article applies to:

  - Microsoft SQL Server version 4.2 for OS/2

Under SQL Server version 4.2, stored procedures can report a return status that indicates whether they completed successfully or the reasons for failure. SQL Server-defined return status values for failure range from -1 to -99; users can define their own return status values outside this range.

Under the 4.2 release, failure values -1 to -14 are currently in use, with 0 indicating a successful completion. These reserved return values actually map to the 10--the severity level of the error causing the execution failure in the stored procedure. For instance, a severity 16 error within the stored procedure causes a status of -6 (10-16) to be returned. Similarly, a severity 24 error would cause a return status of -14. When executing remote procedure calls across SQL Servers, a -6 return status will also be returned in the event that the remote procedure does not exist.


Additional query words: 4.20 4.20a Transact-SQL
Keywords : kbprg SsrvTran_SQL
Version : 4.2
Platform : OS/2


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 3, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.