List out the differences between global and local temp tables in sql server?



List out the differences between global and local temp tables in sql server?..

Answer / Satendra Kumar

In SQL Server, Temp Tables can be either Local or Global. The key differences between them are:nn1) Scope: Local temp tables exist only for the current session, while global temp tables can be accessed by all sessions within the database.nn2) Creation: Local temp tables must be given a unique name in the session that creates it, whereas global temp tables are assigned a system-generated name.nn3) Lifetime: Local temp tables are dropped automatically when their session ends, whereas global temp tables persist until explicitly dropped.nn4) Performance: Local temp tables usually provide better performance compared to global temp tables due to the fact that they're stored in memory.

Is This Answer Correct ?    0 Yes 0 No

Post New Answer

More SQL Server Interview Questions

How column data types are determined in a view?

1 Answers  


Some queries related to SQL

1 Answers   Motorola,


What is meant by datasource?

1 Answers  


Consider the table T1 it consits A,2,3,4 consider another table t2 it contain 1,2a,3a,4a now i need o get the upadted answer

3 Answers  


How to automatically create a log when an exception is being received into SQL Server?

1 Answers   Cap Gemini,


Differentiate between a local and a global temporary table?

1 Answers  


What is the definition for sql server 2000?

1 Answers  


What is the impact on other user sessions when creating indexes?

1 Answers  


What is row-level compre?

1 Answers  


Explain datetime2 data type in sal server 2008?

1 Answers  


What are the two authentication modes in sql server?

1 Answers  


What is dirty read?

1 Answers  


Categories