Click here to Skip to main content
14,640,723 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi
I am having stored procedure which will return two result set and i am calling this stored procedure into another stored procedure .
is there any way to stored the second result set into table variable
Posted
Rate this:
Please Sign up or sign in to vote.

Solution 1

why not use a view instead of a stored procedure for the first one?
   
Comments
Sachin MCA2012 22-Jun-15 11:55am
   
my stored procedure contain various filter and in first result set it will show only the selected filter data.
and in second result set contain all the fields (ie selected + unselected)
stored procedure is about 2000 lines
please help
Rate this:
Please Sign up or sign in to vote.

Solution 2

SELECT INTO #temptable FROM OPENROWSET (connectionstring/storedproc)

http://stackoverflow.com/questions/653714/insert-results-of-a-stored-procedure-into-a-temporary-table[^]

please see above link for better examples and a few other ideas, OPENROWSET may not be the best in terms of speed.
   

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100