December 14, 2008 at 11:04 pm
Hi,
I have a SP whose ouput i need to use in another SP.
I wish to use the output of this SP in another SP.
However,I am aware of using a table variable to store the results of the first one and then using it.
Is there any other solution apart from this.
Can i directly call the SP from select stmt [ specifically in from clause of select stmt] ?
Any help on this would be appreciated.
Thanks and Regards,
Priyanka
December 14, 2008 at 11:24 pm
You could create a temporary table and then INSERT the output of the EXEC into it:
Create table #temp(
...
)
INSERT into #temp
EXEC spFubar
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 14, 2008 at 11:41 pm
priyanka.scholar (12/14/2008)
Hi,I have a SP whose ouput i need to use in another SP.
I wish to use the output of this SP in another SP.
However,I am aware of using a table variable to store the results of the first one and then using it.
Is there any other solution apart from this.
Can i directly call the SP from select stmt [ specifically in from clause of select stmt] ?
Any help on this would be appreciated.
Thanks and Regards,
Priyanka
you cannot use sp in the select statusement, ut you can use Functions instead of that
kshitij kumar
kshitij@krayknot.com
www.krayknot.com
December 14, 2008 at 11:42 pm
Hi RBarryYoung,
Thanks for replying. However I am aware of this solution.
Is there any other soln without the use of temp tables?
I mean, can I use the SP and pass the parameters and directly use the Output columns to join with another table.
Thanks,
Priyanka
December 14, 2008 at 11:59 pm
You cannot use output columns of a sp to join with other tables.
"Keep Trying"
December 15, 2008 at 12:58 am
Thanks a lot for all the replies.
December 15, 2008 at 9:13 am
priyanka.scholar (12/14/2008)
Is there any other soln without the use of temp tables?I mean, can I use the SP and pass the parameters and directly use the Output columns to join with another table.
No.
[font="Times New Roman"]-- RBarryYoung[/font], [font="Times New Roman"] (302)375-0451[/font] blog: MovingSQL.com, Twitter: @RBarryYoung[font="Arial Black"]
Proactive Performance Solutions, Inc. [/font][font="Verdana"] "Performance is our middle name."[/font]
December 15, 2008 at 9:36 am
The only RDBMS system that I know of that allows using stored procedures like tables is InterBase.
It happened to be one of the RDBMS we were evaluating at my previous employer back in 1996.
Viewing 8 posts - 1 through 7 (of 7 total)
You must be logged in to reply to this topic. Login to reply