Translate

Saturday, February 16, 2013

Temp Tables Vs Table Variables

I have posted couple of blog post on the above topic which are very popular.

Those blog posts were,

Temp Tables Vs Table Variables Vs CTE

What's the difference between a temp table and table variable in SQL Server-

Today I came across with nice picture which explains every thing from http://sqlserverplanet.com

image

Isn’t this very simple and easy to understand?

2 comments:

  1. Temporary Tables vs. Table Variables and Their Effect on SQL Server Performance ::
    http://www.codeproject.com/Articles/18972/Temporary-Tables-vs-Table-Variables-and-Their-Effe

    ReplyDelete
  2. Mostly correct but does have some inaccuracies or omissions.

    Table variables DO write to the tempdb log file. Non clustered indexes can be created via unique or primary key constraints. Also to be clear the issue with parallelism only applies to data modification queries not SELECT queries.

    See http://dba.stackexchange.com/q/16385/3690

    ReplyDelete