Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 Holding the Resultsets in an Outer Procedure.

Author  Topic 

8022421
Starting Member

45 Posts

Posted - 2011-02-24 : 05:47:47
Hi,
I having a procedure1 which returns 3 resultsets,I am trying to execute procedure1 from procedure2, is it possible to hold the result sets from procedure1 and stor it in a temp table in procedure2. I am not supposed to change the procedure1.Is this is possible?

Thanks
Dhana

Ifor
Aged Yak Warrior

700 Posts

Posted - 2011-02-24 : 06:20:26
T-SQL cannot handle multple result sets from a sub-SP.

If you cannot alter Procedure 1 then Procedure 2 will have to be a CLR procedure using ADO.NET to handle the result sets. It may just be simpler to do this in the middle tier.
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-02-24 : 06:32:55
You vote for it on Connect. Make your voice heard over at Microsoft!
Vote here http://connect.microsoft.com/SQLServer/feedback/details/470881/allow-more-than-one-resultset-to-be-stored-with-insert-into-exec-syntax



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2011-02-24 : 09:11:49
quote:
Originally posted by 8022421

Hi,
I having a procedure1 which returns 3 resultsets,I am trying to execute procedure1 from procedure2, is it possible to hold the result sets from procedure1 and stor it in a temp table in procedure2. I am not supposed to change the procedure1.Is this is possible?

Thanks
Dhana


Currently possible if all three resultsets are identical in datatype and number of columns

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page

SwePeso
Patron Saint of Lost Yaks

30421 Posts

Posted - 2011-02-24 : 11:12:29
It's still possible. You only need same number of columns.
Make sure your destination table has a column datatype that can accomodate all resultsets.



N 56°04'39.26"
E 12°55'05.63"
Go to Top of Page
   

- Advertisement -