Returning a result set from a Stored Procedure 
Author Message
 Returning a result set from a Stored Procedure
Hi

I am trying to find out how to return a result set from one stored procedure
into a temp(#) table.

1.StoredProc1 calls (exec) StoredProc2.
2.StoredProc2 performs various steps, resulting in a temp table #temp_sp2
3. I need StoredProc1 to now have a temp table #temp_sp1 containing the data
that is in #temp_sp2

Any help would be highly appreciated.

Thanks in advance

Craig



Mon, 27 Sep 2004 17:55:21 GMT
 Returning a result set from a Stored Procedure

Craig,

In proc 1, you just do:

INSERT tbl
 EXEC proc1

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


Quote:
> Hi

> I am trying to find out how to return a result set from one stored procedure
> into a temp(#) table.

> 1.StoredProc1 calls (exec) StoredProc2.
> 2.StoredProc2 performs various steps, resulting in a temp table #temp_sp2
> 3. I need StoredProc1 to now have a temp table #temp_sp1 containing the data
> that is in #temp_sp2

> Any help would be highly appreciated.

> Thanks in advance

> Craig



Mon, 27 Sep 2004 18:19:16 GMT
 Returning a result set from a Stored Procedure
Thanks Tibor.

would my last statement in StoredProc2 have to be something like
    Select <fields>
    from     #temp_sp2
???
Thanks

Craig



Quote:
> Craig,

> In proc 1, you just do:

> INSERT tbl
>  EXEC proc1

> --
> Tibor Karaszi, SQL Server MVP
> Archive at:

http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...
Quote:



> > Hi

> > I am trying to find out how to return a result set from one stored
procedure
> > into a temp(#) table.

> > 1.StoredProc1 calls (exec) StoredProc2.
> > 2.StoredProc2 performs various steps, resulting in a temp table
#temp_sp2
> > 3. I need StoredProc1 to now have a temp table #temp_sp1 containing the
data
> > that is in #temp_sp2

> > Any help would be highly appreciated.

> > Thanks in advance

> > Craig



Mon, 27 Sep 2004 18:32:42 GMT
 Returning a result set from a Stored Procedure
Yes, just do a regular SELECT in the inside proc. :-)

--
Tibor Karaszi, SQL Server MVP
Archive at: http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...


Quote:
> Thanks Tibor.

> would my last statement in StoredProc2 have to be something like
>     Select <fields>
>     from     #temp_sp2
> ???
> Thanks

> Craig



> > Craig,

> > In proc 1, you just do:

> > INSERT tbl
> >  EXEC proc1

> > --
> > Tibor Karaszi, SQL Server MVP
> > Archive at:
> http://groups.google.com/groups?oi=djq&as_ugroup=microsoft.public.sql...



> > > Hi

> > > I am trying to find out how to return a result set from one stored
> procedure
> > > into a temp(#) table.

> > > 1.StoredProc1 calls (exec) StoredProc2.
> > > 2.StoredProc2 performs various steps, resulting in a temp table
> #temp_sp2
> > > 3. I need StoredProc1 to now have a temp table #temp_sp1 containing the
> data
> > > that is in #temp_sp2

> > > Any help would be highly appreciated.

> > > Thanks in advance

> > > Craig



Mon, 27 Sep 2004 18:36:52 GMT
 
 [ 4 post ] 

 Relevant Pages 

1. return multiple result sets from a stored procedure

2. How not to return multiple result sets from a stored procedure

3. Returning a result set from a stored procedure

4. Returning Multiple Result Sets for Java Stored Procedures

5. returning result sets from stored procedures

6. Returning result sets in oracle stored procedure (OLEDB)

7. Can't update result set returned from stored procedure using RDO

8. Returning result set from function to stored procedure is very slooooooooow

9. best way to return a paged result set from a stored procedure

10. returning result sets from stored procedures

11. Stored Procedure/Multiple Return Results/Set Statement

12. return result set from stored procedure


 
Powered by phpBB® Forum Software