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
CREATE TABLE #TempTable;
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-
CREATE TABLE ##TempTable;
Markdown for AI
A clean, structured version of this page for AI assistants and LLMs.
We use cookies to ensure you have the best browsing experience on our website. By using our site, you
acknowledge that you have read and understood our
Cookie Policy &
Privacy Policy.
SQL 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-