I have a stored procedure that I am trying to test. I am trying to test it through SQL Management Studio. In order to run this test I enter ...
exec my_stored_procedure 'param1Value', 'param2Value'
The final parameter is an output parameter
. However, I do not know how to test a stored procedure with output parameters.
How do I run a stored procedure with an output parameter?
I'm using output parameter in SQL Proc and later I used this values in resultset.
Procedure Example :
How to call this procedure
The easy way is to
right-click
on theprocedure
in Sql Server Management Studio(SSMS),select
execute stored procedure...
and add values for the input parameters as prompted.
SSMS
will then generate the code to run the proc in a new query window, and execute it for you. You can study the generated code to see how it is done.Check this, Where first two parameters are input parameters and 3rd one is Output parameter in Procedure definition.
Return val from procedure