What is the Difference Between a Local and a Global Temporary Table in SQL Server ?

A local temporary table exists only for the duration of a connection, or if defined inside a compound statement, for the duration of the compound statement.

A global temporary table remains in the database permanently, but the rows exist only within a given connection. When the connection is closed, the data in the global temporary table disappears. However, the table definition remains with the database for access when a database is opened next time.



You May Interest

What is the Difference Between Clustered and a Non-clustered Inde ...

Listing Metadata of MS SQL Server Internal Tables

What is the Maximum Number of Columns a Table in SQL Server ?

What is a ROLLUP Clause in SQL Server ?

What is an Online Rebuilding of Indexes in SQL Server ?