Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 Transact-SQL (2000)
 Calling a stored procedure within another stored p

Author  Topic 

vnswathi
Starting Member

8 Posts

Posted - 2006-05-23 : 13:38:06
Hi All,

could anyone help me with an example as to how to call a stored procedure from another procedure.

I need to call sprocA, which inserts values in DB and also retuns an integer value, pass this integer value to sprocB and perform some inserts.

Thanks in advance,

vnswathi.

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2006-05-23 : 13:40:52
CREATE PROC sprocA
AS

DECLARE @i int
INSERT INTO SomeTable (...) VALUES(...)
SET @i = SCOPE_IDENTITY()

EXEC sprocB @i
GO


Tara Kizer
aka tduggan
Go to Top of Page
   

- Advertisement -