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. I’m offering a 75% discount to my blog readers if you click from here. I’m also available for consulting if you just don’t have time for that, and need to solve database performance problems quickly. You can also get a quick, low cost health check with no phone time 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?