SQL question?
how (or is there a way) to execute store procedure inside another store procedure?
i.e.
create procedure [sp_1]
as
-- execute a store procedure sp_2 here
-- and grab the result of the sp_2
go
i.e.
create procedure [sp_1]
as
-- execute a store procedure sp_2 here
-- and grab the result of the sp_2
go
I believe you can just use the "EXEC" command to "exec"ecute another stored procedure:
Create procedure dbo.sp_1
AS
DECLARE @meh INT
SET @meh = EXEC dbo.sp_2
GO
something like that. Assuming of course sp_2 returned an int. It can be whatever obviously.
Create procedure dbo.sp_1
AS
DECLARE @meh INT
SET @meh = EXEC dbo.sp_2
GO
something like that. Assuming of course sp_2 returned an int. It can be whatever obviously.
thanks so much
i did this and it seems to be working
Create procedure dbo.sp_1
AS
DECLARE @meh INT
EXEC dbo.sp_2
@sp_2_output = @meh output -- @sp_2_output is declared as output in sp_2
GO
i did this and it seems to be working
Create procedure dbo.sp_1
AS
DECLARE @meh INT
EXEC dbo.sp_2
@sp_2_output = @meh output -- @sp_2_output is declared as output in sp_2
GO
Thread
Thread Starter
Forum
Replies
Last Post
DR. JEKYLL
Off-topic Talk
0
Jan 7, 2003 09:18 PM



