I\'ve been battling this one for a while now. I have a stored proc that takes in 3 parameters that are used to filter. If a specific value is passed in, I want to filter on that
SQL 2008 and later make some improvements to optimization for things like (MyCase IS NULL OR MyCase = @MyCaseParameter) AND ....
If you can upgrade, and if you add an OPTION (RECOMPILE)
to get decent perf for all possible param combinations (this is a situation where there is no single plan that is good for all possible param combinations), you may find that this performs well.
http://blogs.msdn.com/b/bartd/archive/2009/05/03/sometimes-the-simplest-solution-isn-t-the-best-solution-the-all-in-one-search-query.aspx