In MS SQL Server 2008, inserting Rows into a table variable became painfully slow all the sudden.
The creation of a table variable and query and insertion rows is done in a sproc and it has become terribly slow.
The query completes virtually instantly, returns a small set (10 rows of 1 column of ints), and takes upward of 50 seconds to insert into the table variable.
I switched back to temp tables and that is fine, the operation happens in a few microseconds.
From table (Transact-SQL)