I want to run a stored procedure here and want to store the value in output paramater. But I am getting the below error in Bracket. While stored procedure complied successfully. Please check and let me know where I am worng?

The easiest way to figure out the syntax of how to call the stored procedure if you are not sure is to right click on the stored proc name in object explorer in SSMS, and select Script Procedure as -> Execute To -> New Query Editor window. That will give you a window with all the right declarations etc. and you just have to set the input variables. So it would be something like this:

Not sure what the problem is. I recreated your stored proc (although with just dummy data) and ran it, and it seems to run fine. Compare your code against this - or post the stored proc, and the query you are running:

For Sunitabeck's code to run correctly you need to put a "GO" before the "-- Query". The code to create the SP will include all the code until a batch is terminated. That would either be from a "GO" or if you execute just highlighted portion of the code.

You will get that error if you try to execute you SP without declaring your local version of the SP's output variable.I like to explicitly call SPs with the @parameter = @localVariable syntax just for clarity sake. You may be confused by the local variable named the same as the procedure parameter.so: