October 13, 2011 at 8:31 pm
hello guys,
Is it true that when you created a table variable, and inserted a data on that table variable all stored on tempdb? same as temp table(#table)?
thanks in advance
October 13, 2011 at 8:44 pm
REad this and try the code to learn
or this one .. does not require as much code
http://cybersql.blogspot.com/2009/12/yes-table-variables-and-temp-tables.html
October 13, 2011 at 9:09 pm
Teemo (10/13/2011)
hello guys,Is it true that when you created a table variable, and inserted a data on that table variable all stored on tempdb? same as temp table(#table)?
thanks in advance
Yes... and so are Temp Tables. What many don't know is that both Table Variables and Temp Tables both start out physically living in memory and, if they get too big, "spool" to disk.
Please see the articles that BitBucket pointed you to and then read the following excellent article written by Wayne Sheffield on other differences and similarities between Table Variables and Temp Tables...
http://www.sqlservercentral.com/articles/Temporary+Tables/66720/
--Jeff Moden
Change is inevitable... Change for the better is not.
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply