July 31, 2004 at 12:36 am
Hi,
How can i retrun two resultsets from a stored procedure.
Regards,
Hatim Ali.
August 1, 2004 at 7:36 am
For what it is worth, here are a few thoughts:
1. What about calling the stored procedure twice, passing an argument each time to indicate the result set you are looking for?
2. You could combine the result sets with a UNION.
3. Use two different procedures.
4. Use two select statements.
August 1, 2004 at 1:09 pm
You can return two resultsets just be doing two selects:
select top 10 * from tablea
select top 10 * from tableb
Both ADO and ADO.Net support it, though in both it's up to identify which resultset is which based on the order you retrieved them. The advantage is one round trip instead of two.
August 1, 2004 at 9:57 pm
Thanks Andy an Don,
Andy could you please tell me some code samples or post a link for achieving this using ADO or ADO.NET.
Thanks and Regards,
Hatim Ali.
August 2, 2004 at 5:09 am
Sample code for VB:
http://support.microsoft.com/default.aspx?scid=kb;EN-US;182290
Search google for "multiple recordsets" you should find quite a few references.
August 2, 2004 at 5:59 am
Thanks Andy....
Viewing 6 posts - 1 through 5 (of 5 total)
You must be logged in to reply to this topic. Login to reply