Monday 30 March 2015

Temporary Table vs. Table Variable:-


This article we will discuss about temporary table and table variable. What is the difference between both.
   Temporary Table
    Table Variable
1- Syntax-  create  table  #temp
1-Syntax- Declare @tablename Table
2-It support DDL operation :-like drop, create, alter etc.
2- It doesn’t support DDL operation.
3-It participate the explicitly transactions defined by the user.
3- It doesn’t participate in the explicit transactions defined by the user.
4- It doesn’t allowed in  UDF
4- It can be used in user defined functions
5- It support adding indexes explicitly after table creation.
5-It doesn’t adding indexes explicitly.

No comments:

Post a Comment