Possible Duplicate:
What's the difference between a temp table and table variable in SQL Server?
I am using a table variable to store the aggregate results of a query.
The query is as below
update @results
set col1 = totals
from ( select sum(x) as totals from ......)
where id = 1
If I use a temp table the query runs much faster.
Should the use of table variable or temp table matter in the query above?
Am I overlooking something?
thanks