SQL Server For Beginners: Why Declared Variables Cause Bad Estimates Demo

Why Declared Variables Cause Bad Estimates


Going Further

Someone still has to know enough SQL Server to keep the robots in check, and that’s what my training is for.



2 thoughts on “SQL Server For Beginners: Why Declared Variables Cause Bad Estimates Demo”

  1. How can you recommend using dynamic queries compare to non-dynamic ones if the later gets better plan by hashing the query?

    I only do static non-dynamic and never used option recompile before

    1. Yoni — I’m having trouble parsing your question, here.

      Can you clarify what you mean by “hashing the query”, and where you see a non-dynamic query getting a better plan?

Comments are closed.