Consider the following T-SQL code snippet:
CREATE PROC dbo.SquareNum(@i INT OUTPUT) AS BEGIN SET @i = @i * @i --SELECT @i END GO DECLARE @a INT = 3, @b INT = 5 EXEC dbo.SquareNum @a OUTPUT EXEC dbo.SquareNum @b SELECT @a AS ASQUARE, @b AS BSQUARE GO DROP PROC dbo.SquareNum
Result set:
ASQUARE BSQUARE ----------- ----------- 9 5
As you can see, @b not a square, b / c it was not passed as an output parameter (there is no OUTPUT when passing in the parameter).
I would like to know if there is a way to check inside the body of the stored procedure (body dbo.SquareNum in this case) to see if the parameter is really passed as an OUTPUT parameter?
sql-server tsql stored-procedures output-parameter
M. Rashid
source share