(Print this page)

SQL Server – Parameter sniffing & Stored Procedures Execution plan
Published date: Friday, January 30, 2009
On: Moer and Éric Moreau's web site

I was helping a friend with a stored procedure that was performing very bad comparing to the corresponding dynamic query and then he found a very interesting article that demonstrates that you should never use the parameters of a stored procedure directly in that stored procedure. Instead, we should always copy the value of those parameters to variables and use those variables.

If you use stored procedure, I strongly suggest that you take 2 minutes and read http://omnibuzz-sql.blogspot.com/2006/11/parameter-sniffing-stored-procedures.html


(Print this page)