• wrote:

    Sometimes SQL Server underestimates the work you’re about to do, and doesn’t grant you enough memory. Say you’re working with a table variable, and SQL Server only estimates it’ll find one row inside – but millions of rows start to come back. Your query doesn’t get granted more memory, oh no – it just spills to disk (TempDB.) What’s worse, if you run that query a hundred times, it’ll spill to disk every single time.

    I was about to comment on this, then I read the end of your post. 2019 has addressed this issue, but it has broken a dozen more. #prayingforaservicepack

     

    MVDBA