PRB: SQL Server Returns Output Parameters Only After Resultsets (256234)
The information in this article applies to:
- ActiveX Data Objects (ADO) 2.0
- ActiveX Data Objects (ADO) 2.01
- ActiveX Data Objects (ADO) 2.1
- ActiveX Data Objects (ADO) 2.1 SP1
- ActiveX Data Objects (ADO) 2.1 SP2
- ActiveX Data Objects (ADO) 2.5
This article was previously published under Q256234 SYMPTOMS
When stored procedures (SP) are executing in Microsoft SQL Server, output parameters are returned only after all of the resultsets have been completely fetched to the client. Attempts that are made to read output parameters prior to a full fetch of all resultsets do not return data.
CAUSE
The default cursorLocation property of a connection object is adUseServer, a server side cursor. When executing a SQL statement that returns a recordset with the default cursorLocation property, not all of the matching rows are returned to the client program at once. Until all of the rows are fetched and returned to the client, any output parameter from a stored procedure is not returned.
RESOLUTION
Setting the cursorLocation property of the connection object to adUseClient, a client side cursor, causes all the records in the resultsets to be fetched immediately and returned to the client program, allowing access to both the resultset and output parameters immediately after the procedure is run.
STATUS
This behavior is by design.
Modification Type: | Major | Last Reviewed: | 9/30/2003 |
---|
Keywords: | kbprb KB256234 |
---|
|