>SQL Server: Table Variables Are Created In Memory Or In Tempdb


>

In response to the earlier post How to Create Different Type of Tables a reader asked a question that

 

“Is it true that temp table are created in Tempdb but Table variables are created only in memory and because of this, table variables are more efficient as compared to temp tables”

 

My answer is that, it’s just a misconception that table variables are created in memory and truth is that both temporary tables and table variables are created in tempdb. Pinal Dave and Ken Simmons already proved it so well. So I will suggest reading these posts for more clarifications.

SQL SERVER – Difference TempTable and Table Variable – TempTable in Memory a Myth By Pinal Dave

Yes, Table Variables and Temp Tables both use the tempdb By Ken Simmons

Advertisements

Posted on January 27, 2011, in Sql Server 2008, Tables. Bookmark the permalink. Leave a comment.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: