Watch this example on YouTube
1. First stored proc
CREATE PROCEDURE Sproc1
@ID int
AS
BEGIN
SET NOCOUNT ON;
SELECT Count(*) From Product Where ProductID > @ID
END
GO
2. Second stored procedure
Alter PROCEDURE SProc2
AS
BEGIN
SET NOCOUNT ON;
Declare @MyID int = 2
Declare @Result int
Exec @Result = SProc1 @MyID
END
3. Execute stored procedure
Exec SProc2
No comments:
Post a Comment