Monday, March 26, 2012

Newbie Question

Hi,
I have a procedure that returns 5 different values. I want to run the procedure in another procedure and use those values in that procdure.

How? How? How?

CREATE Procedure get_Averages_EY @.Quality dec OUTPUT, @.Commitment dec OUTPUT,@.Change dec OUTPUT, @.Strategy dec OUTPUT, @.Leadership dec OUTPUT, @.Environment dec OUTPUT, @.id int

I want to use all of the output values in another procedure.

Thanks!!!Try this one.

create procedure proc1(@.id int,@.id2 int output,@.id3 int output)
as
set @.id2=@.id*2
set @.id3=@.id*10
go
create procedure proc2
as
declare @.id2 int,@.id3 int,@.id int
set @.id=3
exec proc1 @.id,@.id2 output,@.id3 output
select @.id,@.id2,@.id3
go
exec proc2

No comments:

Post a Comment