Anshul
Anshul

Reputation: 645

How to call a stored procedure inside the other stored procedure

I have created a stored procedure in SQL Server 2005, also I create another stored proc (that accepts some input parameters), I have to invoke with the use of the first proc.

Upvotes: 1

Views: 96

Answers (2)

Quassnoi
Quassnoi

Reputation: 425261

CREATE PROCEDURE prc_inner (@value INT)
AS
        SELECT  @value
GO

CREATE PROCEDURE prc_outer (@value INT)
AS
        EXEC prc_inner @value
GO

EXEC prc_outer 1

Upvotes: 3

DanDan
DanDan

Reputation: 10562

Look up EXEC sp_executesql or just plain EXEC [storedprocedurename]

Upvotes: 1

Related Questions