/*Create one SP for multiplicating two values.And passed the result into the variable @v2*/
CREATE PROCEDURE SP_REF
–DECLARE @V1 VARCHAR(50)
@V2 BIGINT OUTPUT
AS
SELECT @V2=@V2*@V2
RETURN
–drop procedure SP_REF
/*Passed the result of the variable in to @v1 and executed.*/
DECLARE @V1 VARCHAR(50)
SELECT @V1=10000
EXEC SP_REF @V1 OUTPUT
PRINT ‘RESULT:’+@V1
/*Create one SP for multiplicating two values.And passed the result into the variable @v2*/
CREATE PROCEDURE SP_REF
–DECLARE @V1 VARCHAR(50)
@V2 BIGINT OUTPUT
AS
SELECT @V2=@V2*@V2
RETURN
–drop procedure SP_REF
/*Passed the result of the variable in to @v1 and executed.*/
DECLARE @V1 VARCHAR(50)
SELECT @V1=10000
EXEC SP_REF @V1 OUTPUT
PRINT ‘RESULT:’+@V1
Advertisement