3 – How Table Variables Affect TempDB
Table variables have a bad reputation because they don’t have statistics. When you go to pull data out of a table variable, SQL Server can’t accurately predict how many rows will come out, and this causes cascading problems in execution plans. But sometimes, that’s actually a good thing. If your SQL Server’s biggest performance problem…
