Code:
ALTER PROCEDURE [dbo].[ap_myTest]
( @my_in int
,@my_out int = 10 output
)
AS
BEGIN
IF @my_in = 5
BEGIN
SET @my_out = 7
END
END
exec ap_myTest 5 @my_out = 7
exec ap_myTest 6 @my_out = null
exec ap_myTest 5,12 @my_out = 7
exec ap_myTest 6,12 @my_out = 12
My question is: Why does @my_out not equal the DEFAULT value of 10 when @my_in = 6?