Why Declared Variables Cause Bad Estimates
Going Further
If this is the kind of SQL Server stuff you love learning about, you’ll love my training. Blog readers get 25% off the Everything Bundle — over 100 hours of performance tuning content. Need hands-on help? I offer consulting engagements from targeted investigations to ongoing retainers. Want a quick sanity check before committing to a full engagement? Schedule a call — no commitment required.
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
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?