What are the differences between local and global temporary tables?
What are the differences between local and global temporary tables?
Jr. Software Developer
I am a software developer at MindStick soft. Pvt. ltd. I joined this company in august 2021 after completing my post-graduation course. I love to see the historical places of my country.
In SQL, a local temporary table lives until the connection is valid or until the duration of a compound statement. A global temporary table is permanently present in the database. However, the rows of the table are present until the connection is existent.
There are two types of temporary tables: local and global. Here are the differences between them:
In summary, local temporary tables are created and destroyed within the current session and are only visible to the current user, while global temporary tables can be accessed across sessions and are visible to all users who have permissions to access them.
Difference between local temporary tables and global temporary tables are as follows: