SQLMoreResults

SQL Server Native Client (SNAC) is not supported beyond SQL Server 2012. Avoid using SNAC in new development work, and plan to modify applications that currently use it. The Microsoft ODBC Driver for SQL Server provides native connectivity from Windows to Microsoft SQL Server and Microsoft Azure SQL Database.

SQLMoreResults allows the application to retrieve multiple sets of result rows. A Transact-SQL SELECT statement containing a COMPUTE clause, or a submitted batch of ODBC or Transact-SQL statements, causes the SQL Server Native Client ODBC driver to generate multiple result sets. SQL Server does not allow creating a server cursor to process the results in either case. Therefore, the developer must ensure that the ODBC statement is blocking. The developer must exhaust the returned data or cancel the ODBC statement before processing data from other active statements on the connection.

Note

A Transact-SQL SELECT statement containing a COMPUTE clause is only supported when connecting to a server version prior to SQL Server 2012.

The developer can determine properties of the result sets columns and rows that are generated by the COMPUTE clause of a Transact-SQL SELECT statement. For more detail, see SQLColAttribute.

When SQLMoreResults is called with unfetched data rows in the result set, those rows are lost, and row data from the next result row set is made available.