Mahanti Chiranjeevi
What is the difference between a Temporary Table and a Table Variable?
By Mahanti Chiranjeevi in SQL Server on Jul 26 2014
  • Lalit Raghuvanshi
    Feb, 2015 5

    There is another good article on: 16 main differences between Temporary Table and Table Variable in Sql Server http://www.webcodeexpert.com/2015/02/difference-between-temporary-table-and.html

    • 0
  • Raghav Mehra
    Sep, 2014 1

    1. Temporary Tables are real tables so you can do things like CREATE INDEXes, etc. If you have large amounts of data for which accessing by index will be faster then temporary tables are a good option. 2. Table variables can have indexes by using PRIMARY KEY or UNIQUE constraints. (If you want a non-unique index just include the primary key column as the last column in the unique constraint. If you don't have a unique column, you can use an identity column.) 3. Table variables don't participate in transactions, logging or locking.

    • 0
  • Mahanti Chiranjeevi
    Jul, 2014 26

    -Table variable is created in the memory where as a temporary table is created in the TempDB. -You can pass table variable as parameter to functions and stored procedures, where as you cannot do the same with temporary table.

    • 0


Most Popular Job Functions


MOST LIKED QUESTIONS