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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Calling a stored procedure from another stored procedure

Status
Not open for further replies.

onetomany

Programmer
May 15, 2000
55
US
I need to know how to call a stored procedure from a stored procedure and also if I can pass variables to the called stored procedure.I am using SQL SERVER 7.0<br><br><br><br>thanks
 
Yes, stored procedures can easily be called from other stored procedures by using EXECUTE:<br><br>eg.<br><br>DECLARE @Var1 INT<br>DECLARE @Var2 VARCHAR(20)<br><br>SELECT @Var1 = 20<br>SELECT @Var2 = 'Fred'<br><br>Execute sp_Name @var1, @Var2<br><br>Chris Dukes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top