When to Process Results

It is critical that all result sets are processed completely in a timely manner. The result sets need to be processed to avoid problems with subsequent SQL Server queries and to avoid concurrency issues with SQL Server resources.

In most cases, the return code from dbsqlok or dbsqlexec should be ignored. If you send the following batch and the INSERT statement fails due to a duplicate key, a severity 14 error is generated; however, the batch continues.

INSERT INTO tblTest VALUES(1)

SELECT @@VERSION

  

The dbsqlok and dbsqlexec calls check only the success of the first command. If you do not call dbresults, you will not process the SELECT statement results and can get result pending errors.

The following are the most common problems your application may encounter if result sets are not handled immediately and completely:

  


(c) 1988-98 Microsoft Corporation. All Rights Reserved.