SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 SQL Server 2008 Forums
 Transact-SQL (2008)
 How to combine result sets of different stored pr
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Sql_forum
Yak Posting Veteran

India
50 Posts

Posted - 12/29/2011 :  05:48:55  Show Profile  Reply with Quote
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
Flowing Fount of Yak Knowledge

2161 Posts

Posted - 12/29/2011 :  06:39:03  Show Profile  Reply with Quote
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

India
50 Posts

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

sunitabeck
Flowing Fount of Yak Knowledge

5155 Posts

Posted - 12/29/2011 :  07:49:11  Show Profile  Reply with Quote
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

India
50 Posts

Posted - 01/05/2012 :  07:07:10  Show Profile  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.14 seconds. Powered By: Snitz Forums 2000