Or
Use row-wise binding. For more information, see Using Rowset Binding.
If it returns SQL_SUCCESS, another result set is available.
If it returns SQL_NO_DATA_FOUND, no more result sets are available.
If it returns SQL_SUCCESS_WITH_INFO or SQL_ERROR, call SQLError to determine if the output from a PRINT or RAISEERROR statement is available.
If bound statement parameters are used for output parameters or the return value of a stored procedure, use the data now available in the bound parameter buffers.
Note that when a result set contains compute rows, each compute row is made available as a separate result set. These compute result sets are interspersed within the normal rows and break up the normal rows into multiple result sets.