SQL Server – Execute Stored Procedure with Output Parameter?
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?
Thank you!


arora on Mar 05, 2013
The easy way is to right-click on the procedure 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.
fernando-correia on Mar 05, 2013
From http://support.microsoft.com/kb/262499
Example:
Hope this helps!
arora on Mar 05, 2013
you can do this :
harry on Mar 05, 2013
Return val from procedure