What is Local and Global Temporary tables in SQL Server?
What is Local and Global Temporary tables in SQL Server?
343
10-Nov-2021
Updated on 10-Nov-2021
Steilla Mitchel
10-Nov-2021SQL Local and Global temporary table:
Local Temporary Table:
Local temporary table is a table that is created when connection is established and appear on a connection. It is closed when the connection is closed. A local temporary table is create with # symbol as prefix. Scope of a local temporary table is inside the session.
Syntax for creating a local temporary table
Global Temporary Table;
A Global temporary table is created when connection is created and it shows all the users. It is closed when the connection is closed. A Global temporary is represented with ## symbol before the table name. The scope of the Global temporary table is outside of the session.
Syntax-