Thanks in advance for any help you may be able to provide.
Andy
The main difference between table variables and temp tables is scope and
internals, such as locking.
Hope this helps.
Dan Guzman
SQL Server MVP
-----------------------
SQL FAQ links (courtesy Neil Pike):
http://www.ntfaq.com/Articles/Index.cfm?DepartmentID=800
http://www.sqlserverfaq.com
http://www.mssqlserver.com/faq
-----------------------
"Andrew Hauger" <a_ha...@yahoo.com> wrote in message
news:rwll8.27480$Dv6.8...@typhoon.austin.rr.com...
Are you sure? I thought one big advantage of table variables was that they
were in memory only and not written to TempDB? It's been awhile since I've
looked at this though.
In general, table variables will be held in memory, however if the amount of
data loaded into a table variable does grow large enough, then SQL Server
will write the data to tempdb.
It's not unlike the situation with an ORDER BY clause. If possible, SQL
Server will try to do sorting in memory, but it might have to write to
tempdb if the result set being sorted is large.
-------------------------------------------
BP Margolin
Please reply only to the newsgroups.
When posting, inclusion of SQL (CREATE TABLE ..., INSERT ..., etc.) which
can be cut and pasted into Query Analyzer is appreciated.
"Greg D. Moore (Strider)" <moo...@greenms.com> wrote in message
news:jeol8.140134$V15.23...@typhoon.nyroc.rr.com...
Hope this helps.
"Greg D. Moore (Strider)" <moo...@greenms.com> wrote in message
news:jeol8.140134$V15.23...@typhoon.nyroc.rr.com...
>
"Dan Guzman" <dang...@nospam-earthlink.net> wrote in message
news:SzHl8.1163$MC5.1...@newsread2.prod.itd.earthlink.net...