Groups | Blog | Home
all groups > sql server programming > june 2004 >

sql server programming : SQL Server with ADO Recordset - How to return the recordset from Stored Procedures, if it has multiple select statements


Aaron [SQL Server MVP]
6/9/2004 10:46:51 AM
Make sure you add SET NOCOUNT ON to the beginning of the stored procedure.
This will prevent the "n row(s) affected" message from being interpreted by
ADO as an empty, closed recordset.

If you need to process multiple recordsets, you can use the NextRecordset()
method of ADODB.Recordset.

--
http://www.aspfaq.com/
(Reverse address to reply.)




[quoted text, click to view]

Suresh Ponraj
6/9/2004 8:14:17 PM
Hi all

I am using SQL Server with ADO Recordset.

I am having insert statements and update statements in this stored procedure
(SP). I need to return a recordset from this SP. The last statement of this
SP is:

Select @svOutPut As Status, @lngReturnTransactionNo As TransactionNo,
@svErrCode As ErrCode, @svErrMessage As ErrMessage

If I comment the insert and update statements, I am able to receive the data
in the ADO recorset, else I am not able to receive.

Can anyone help me how to send the data from the SP to an ADO recordset even
if I have insert and update statements ?

Thanks and Regards,

Suresh P

AddThis Social Bookmark Button