Search This Blog

Monday, January 21, 2013

Temporary Tables (SQL Server)

SQL Server > Temporary tables

Local temporary tables
  • visible only to their creators during the same connection to an instance of SQL Server
  • deleted after the user disconnects from the instance of SQL Server
  • local temporary table name is stared with hash ("#") sign.
Example

Create temporary table

    Global temporary tables

    • visible to any user and any connection after they are created
    • deleted when all users that are referencing the table disconnect from the instance of SQL Server
    • global Temporary tables name starts with a double hash ("##")