Michael Krumpe
asked on
Multiple Output parameters in a stored proceedure
How do I format a stored proceedure to return multiple return parameters?
I just need to see a simple example.
(In a rush to search for the answer)
I just need to see a simple example.
(In a rush to search for the answer)
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
create procedure testSp11
@i int ,
@j int,
@sum int output,
@diff int output
as
BEGIN
select @sum = @i +@j
,@diff = @i - @j
END
GO
declare @su int, @dif int
exec testSP11 20,10,@su out,@dif out
select @su,@dif
@i int ,
@j int,
@sum int output,
@diff int output
as
BEGIN
select @sum = @i +@j
,@diff = @i - @j
END
GO
declare @su int, @dif int
exec testSP11 20,10,@su out,@dif out
select @su,@dif
ASKER
Thanks angelIII... the simple answer always works the best!
@inputParam1 INT,
@inputParam2 INT,
@outputParam1 VARCHAR(30) = NULL OUTPUT,
@outputParam2 INT = NULL OUTPUT,
@outputParam3 DATETIME = NULL OUTPUT
AS
...