Tuesday, 30 April 2013

Difference between Table Variable and Temporary Table

Blog Directory
Table Variables
  1. Scope is restricted to current batch.
  2. Max length for Table Variable Name is 128 characters.
  3. If used in Dynamic SQL, Must be declared inside dynamic SQL.



Temporary Tables

  1. Scope is for current session and if global for all sessions.
  2. Max length for Temporary table name is 116 characters.
  3. Existing Temporary tables can be used inside Dynamic SQL.

No comments:

Post a Comment