-- First Stored ProcedureCREATE PROCEDURE SquareSP@MyFirstParam INT
AS
DECLARE @MyFirstParamSquare INT
SELECT @MyFirstParamSquare = @MyFirstParam*@MyFirstParam-- Additional CodeRETURN (@MyFirstParamSquare)GO
-- Second Stored ProcedureCREATE PROCEDURE FindArea@SquaredParam INT
AS
DECLARE @AreaofCircle FLOAT
SELECT @AreaofCircle = @SquaredParam * PI()RETURN (@AreaofCircle)GO
-- Pass One Stored Procedure's Result as Another Stored Procedure's ParameterDECLARE @ParamtoPass INT, @CircleArea FLOAT-- First SPEXEC @ParamtoPass = SquareSP 5-- Second SPEXEC @CircleArea = FindArea @ParamtoPassSELECT @CircleArea FinalArea
GO
Countersy :: http://blog.sqlauthority.com/2013/04/07/sql-server-pass-one-stored-procedures-result-as-another-stored-procedures-parameter/
If u had any trouble just ask, Happy to help u :) Stay Tune... Have a nice day... 'N happy Coding :)
No comments:
Post a Comment