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)
 How to combine result sets of different stored pr

Author  Topic 

Sql_forum
Yak Posting Veteran

50 Posts

Posted - 2011-12-29 : 05:48:55
I have a stored proc which returns one column on execution
i have another proc which returns two values on execution

Now i want to return the value from first SP and other two values from second SP together
how can i get this?

DonAtWork
Master Smack Fu Yak Hacker

2167 Posts

Posted - 2011-12-29 : 06:39:03
Call one SP from the other, then return all values from the originating proc.

http://weblogs.sqlteam.com/jeffs/archive/2008/05/13/question-needed-not-answer.aspx
How to ask: http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

For ultra basic questions, follow these links.
http://www.sql-tutorial.net/
http://www.firstsql.com/tutor.htm
http://www.w3schools.com/sql/default.asp
Go to Top of Page

Sql_forum
Yak Posting Veteran

50 Posts

Posted - 2011-12-29 : 06:48:24
I can't do that way bcoz, i m using those SPs at some other places as well
Go to Top of Page

sunitabeck
Master Smack Fu Yak Hacker

5155 Posts

Posted - 2011-12-29 : 07:49:11
At the risk of sounding like stating the obvious:

Would writing a new stored proc which calls the two existing stored procs, combines the data the way you want it and returns it to the caller be a possibility? You will, of course, have to use the new stored proc where you need the combined results.
Go to Top of Page

Sql_forum
Yak Posting Veteran

50 Posts

Posted - 2012-01-05 : 07:07:10
i want help on same topic.

i am trying to store tesults of a SP into a variable tables and trying.
But in the result set i don't have any unique ID to join those variable tables.
Can some one tell me .. how can i achieve this?
Go to Top of Page
   

- Advertisement -