Sunday 27 August 2017

Difference between global and local Temp Table in sql server

Local Temp table

Ø  Start with a single hash value ‘#’
Ø  Only for the connection in which created
Ø  Stored in TempDB database
Ø  Automatically get deleted when user disconnects or can be deleted using drop command
Ø  In different database same name local temporary table can be created

Global Temp table

Ø  Its name is uniquely defined and starts with the double hash sign ‘##’
Ø  Global temporary tables are visible to all
Ø  Until the referencing connections are open one can access the global temporary table
Ø  Automatically get deleted when all referencing connections closed or can be deleted manually by using DROP command

No comments:

Post a Comment

If you have any doubt, please let me know.

Popular Posts