Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Getting table value from SP

Status
Not open for further replies.

selvirino

Programmer
Jun 18, 2001
17
US
I have an SP that produces a table that can be either one or two columns, depending on a paramter. I'd like to call it from a second SP and accept the result. I can't seem to get the syntax correct to exec the first SP and accept its return value.

Since in this particular instance I know that I'm going to get a single column table back, I have created a temp table and am trying to set the value of the temp table to the records returned by the first SP.

I think this is a confusing explanation of a simple problem: how can one return a table from a SP into another SP?

Sorry for the newbie question, but I've searched this forum and can't seem to find anything quite on point.

 

Create the temp table in the 1st SP. Then insert the result of the 2nd SP into the temp table.

Insert #temp
Exec SP2 Terry L. Broadbent
FAQ183-874 contains tips for posting questions in these forums.
NOTE: Reference to the FAQ is not directed at any individual.
 
Thanks! I just needed the syntax -- now this should be a piece of cake.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top