Call a stored procedure from another stored procedure 
Author Message
 Call a stored procedure from another stored procedure
Hi all

I'm using Sqlserver 2000 .
I would like to know if it is possible to call a stored procedure from
another stored procedure . I'm not in the master database .
If the answer is true would you mind guiving me the syntax.

Thanks for the help in advance.



Tue, 06 Jan 2004 23:00:53 GMT
 Call a stored procedure from another stored procedure

Hi,
Yes, you can call a stored procedure from another. SQL Server supports
also recursion in stored procedure. But, be aware of the nesting level,
which
is 32. For more information refer BOL(Books OnLine). Search for
create procedure, stored procedures.
Good Luck

use pubs
go

/* simple procedure returning a string */
create procedure sp_example1
as

select 'Hello, world'
go

/* stored procedure which calls another one */
create procedure sp_example2
as
/* call the first procedure  */
exec sp_example1

go

exec sp_example2


Quote:
> Hi all

> I'm using Sqlserver 2000 .
> I would like to know if it is possible to call a stored procedure from
> another stored procedure . I'm not in the master database .
> If the answer is true would you mind guiving me the syntax.

> Thanks for the help in advance.



Wed, 07 Jan 2004 02:42:48 GMT
 Call a stored procedure from another stored procedure
Wassim,

One executes a stored procedure by prefacing it with EXECUTE, for example
...

create procedure spWassim_1 as
 exec spWassim_2
go

-------------------------------------------
BP Margolin
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:
> Hi all

> I'm using Sqlserver 2000 .
> I would like to know if it is possible to call a stored procedure from
> another stored procedure . I'm not in the master database .
> If the answer is true would you mind guiving me the syntax.

> Thanks for the help in advance.



Wed, 07 Jan 2004 06:07:23 GMT
 
 [ 3 post ] 

 Relevant Pages 

1. Calling a Stored Procedure from a Stored Procedure

2. Call a stored procedure in another stored procedure

3. Calling a stored procedure by another stored procedure

4. QUESTION: How can I call a Stored Procedure from another Stored Procedure

5. Calling a Stored Procedure from a Stored Procedure

6. Calling a stored procedure within a stored procedure.

7. How do I call a stored procedure from another stored Procedure

8. Calling A Stored Procedure from another Stored Procedure

9. Calling a stored procedure from a stored procedure

10. calling a stored procedure inside a stored procedure

11. Can I call a stored procedure from a stored procedure

12. Calling Java Stored Procedure from SQL Stored Procedure


 
Powered by phpBB® Forum Software