Thanks Peter K.
That was really interesting.
exec V1 1000000
-- took 5 sec (table variables )
exec T1 1000000 (temp tables)
-- took 4 sec
Generally acceptable wisdom, @tablevariable is faster due to no logging like #temptable.
I always wondered though...SQL Server has to have a buffer limit on table variables and will start writing to disk when over limit?
Kalman Toth, MCDBA, MCITP ( administrator, developer, bi developer)
SQL Server 2005 Training: http://www.sqlusa.com/order2005grandslam