Check perfmon to see if maybe the SQL server is just totally out of memory. There should be no logical difference between @table and #table, but the second actually creates a database object while the ...
One reoccurring SQL Server question that I see: Why is my TempDB database so large and what can I go to reduce the size of TempDB? The answer requires some basic understanding of the internals of how ...