Home Forums SQL Server 2008 T-SQL (SS2K8) OPTIMIZE FOR UNKNOWN (parameter sniffing problem) RE: OPTIMIZE FOR UNKNOWN (parameter sniffing problem)

  • Roland Alexander STL (9/21/2012)


    Which is the point of using local variables, since it will force a new plan each time the query is run. Of course, this is also the downside of using local variables.

    Excuse my ignorance... but why are local variables a bad thing inside SP? They force the calculation of a new query plan (which is like recompiling?!)?

    Thanks,

    Pedro



    If you need to work better, try working less...