BUG: Dbsqlexec & Dbsqlok Return Code Documentation Is Incorrect

Last reviewed: September 15, 1997
Article ID: Q173844
The information in this article applies to:
  • Microsoft SQL Server, version 6.5
BUG #: 17186 (Windows: 6.5)

SYMPTOMS

SQL Server Books Online says that the dbsqlexec and dbsqlok functions can return SUCCEED or FAIL. The functions can return either of these values; however, the FAIL is only a representation of the current command of the batch.

In most cases, the return code from dbsqlok or dbsqlexec should be ignored. If you send the following batch:

   insert into tblTest values(1)
   select @@VERSION

and the INSERT statement fails due to a duplicate key, a severity 14 error is generated but the batch continues. The dbsqlok and dbsqlexec calls only check the success of the first command. If you do not call dbresults, you will not process the SELECT statement results. In this case, you may get "result pending" errors.

WORKAROUND

To work around this problem, see the following article in the Microsoft Knowledge Base for complete result processing details:

   ARITCLE-ID: Q165951
   TITLE     : INF: Result Processing for SQL Server

In most cases, you will ignore the return code and continue the dbresults looping until either NO_MORE_RESULTS is returned or DBDEAD becomes TRUE. This ensures that all result sets are processed.

STATUS

Microsoft has confirmed this to be a problem in SQL Server version 6.5. We are researching this problem and will post new information here in the Microsoft Knowledge Base as it becomes available.


Additional query words: sev
Keywords : kbbug6.50 SSrvDoc_Err SSrvProg kbprg
Version : WINDOWS:6.5
Platform : WINDOWS
Issue type : kbbug kbdocerr
Solution Type : kbworkaround


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: September 15, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.