SQL Server: Using Parameters and Local Variables

I was trying to get a stored procedure in SQL Server to run using a mixture of parameters passed from an ASP.NET page and a local variable which I wanted to declare in order to modify one of the parameters received.

I couldn't figure out where to put the local variable in relation to the parameters, until I found this page:

http://www.sqlteam.com/article/introduction-to-dynamic-sql-part-2

The parameters go before the 'AS' statement, the local variable after, but before the 'BEGIN' statement if you use it.


Digg This
Reddit This
Stumble Now!
Share on Facebook
Bookmark this on Delicious
Share on LinkedIn
Bookmark this on Technorati
Post on Twitter
Buzz this!


Printed from: http://www.divydovy.com/2008/08/sql-server-using-parameters-and-local-variables/. © divydovy 2017

Leave a Reply