Output Parameter Not Returned
- by Mark Plumpton
Why does this script return a pair of nulls? I'm using SQL Server 2008, script run in MSSMS.
CREATE PROCEDURE proc_Test
(
@Input int,
@Out1 int OUTPUT,
@Out2 varchar(10) OUTPUT
)
AS
BEGIN
SET NOCOUNT OFF
SET @Out1 = 100 + @Input
SET @Out2 = 'result=' + CONVERT(varchar,@Out1)
RETURN
END
GO
DECLARE @Out1 int, @Out2 varchar(10)
exec proc_Test @Input=1, @Out1=@Out1, @Out2=@Out2
select @Out1, @Out2