Using a stored proc to call another stored proc

Using a stored proc to call another stored proc

Post by Jon Pop » Sat, 27 Oct 2001 07:33:03



I'm using SQL Server 7.0.  I've got a stored proc that returns a resultset.
I would like another stored proc to be able to call it and cycle through
that resultset.  Can I do even do this, or should I rethink my design?

Thanks, Jon

 
 
 

Using a stored proc to call another stored proc

Post by Hirantha S. Hettiarachch » Sat, 27 Oct 2001 07:51:28


you'll have to use a temparary table to pass results between stored
procedures.
--
hth
Hirantha S Hettiarachchi MCSD,MCDBA
---------------------------------------------------------------
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.


Quote:> I'm using SQL Server 7.0.  I've got a stored proc that returns a
resultset.
> I would like another stored proc to be able to call it and cycle through
> that resultset.  Can I do even do this, or should I rethink my design?

> Thanks, Jon


 
 
 

Using a stored proc to call another stored proc

Post by Rick Sawtel » Sat, 27 Oct 2001 07:48:52


Yes you can.  There are some limitations however.  This is called nesting
stored procedures.  You can nest stored procedures up to 32 levels deep.  If
you nest further than that, then you will receive an error.  To check the

Rick Sawtell


Quote:> I'm using SQL Server 7.0.  I've got a stored proc that returns a
resultset.
> I would like another stored proc to be able to call it and cycle through
> that resultset.  Can I do even do this, or should I rethink my design?

> Thanks, Jon

 
 
 

Using a stored proc to call another stored proc

Post by peter » Mon, 29 Oct 2001 23:16:37


You might look at sql 7.0 bol topic nesting stored procedures.

Thanks,
Peter

 
 
 

1. Stored Proc Calling Another Stored Proc

I have a table which has a child/parent relationship. I wrote a stored
procedure that returns all the children for any given record. I now want to
use this stored procedure in another stored procedure that will delete the
records retrieved from the first stored procedure. It sounds so simple, but
I'm stumped. How can I store the results from the first stored procedure
into a cursor that I can work with in the second stored procedure?

2. navigating a range of records one by one

3. How to call a stored Proc or Ext Stored proc /T-SQL UDF from VBScript

4. Portland, OR - Oracle DBA for contract to hire or perm. position needed!

5. calling stored proc from stored proc via variable

6. Time limit for SQL statement

7. Calling a stored proc within a stored proc

8. ../\...Advice For New Immigrants^^^..

9. Calling Stored Proc from other Stored Proc

10. a stored proc calling another stored proc

11. Calling another stored proc within a stored proc

12. Calling a Stored proc within a stored proc

13. Calling Stored Proc from another Stored Proc