What is the difference between a Local temporary table and a
Global temporary table? How is each one used?

Answers were Sorted based on User's Feedback



What is the difference between a Local temporary table and a Global temporary table? How is each on..

Answer / sarvesh nakhate

A local temporary table exists only for the duration of a
connection or, if defined inside a compound statement, for
the duration of the compound statement.

A global temporary table remains in the database
permanently, but the rows exist only within a given
connection. When connection is closed, the data in the
global temporary table disappears. However, the table
definition remains with the database for access when
database is opened next time.

Is This Answer Correct ?    17 Yes 9 No

What is the difference between a Local temporary table and a Global temporary table? How is each on..

Answer / tarun kumnar basak

A Local Temporary table is almost the same as the Temporary
table in oracle. The main difference is that in oracle
you've to specify the keyword local in your query and also
Local Temporary table exists only for the user who is
created the table. So no other session can use/see the
temporary table.

Where as GTT is another kind of temporary table in oracle
which is by default the temporary table(if you don't
specify the keyword local). GTT can be used by every
user/schema which is connected to the DB irrespective of
each others session and without knowing what data resides
for a particular user. As soon as you log off from the
server the GTT also deleted. It is more kind of session
specific where the structure of the table is shared among
all users but not the data. Data remains private for each
users session and no Lock can be aquired on the table.

Is This Answer Correct ?    5 Yes 3 No

Post New Answer

More SQL Server Interview Questions

Explain the working of sql privileges?

0 Answers  


What is collation?

0 Answers  


What is user-defined functions? What are the types of user-defined functions that can be created?

0 Answers  


A successfully created SSIS package in SQL Server 2005 runs fine in MS BIDS and Integration Services. But gives error when run through an SQL-Job. What are the possible reasons?

2 Answers   Sapient,


What is model database? : SQL Server Architecture

0 Answers  






Is it possible to have more then one foreign key in a single table? if possible, is this the good way to design the table?

2 Answers  


What is the security principal at the database level that represents your session?

0 Answers  


What gets stored inside msdb database?

0 Answers   Abacus,


How many clustered indexes can be created on a table? I create a separate index on each column of a table. what are the advantages and disadvantages of this approach?

0 Answers  


what is the difference between openrowset and openquery?

0 Answers  


could u plz explain about joins and views?

2 Answers  


what is difference between Enterprise Manager and Query Analyer

6 Answers   CTS,


Categories