Difference Between Temporary Table and Normal Table?
what is the use of temporary table instead of normal table in sql server?
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 12, 2013, 8:00 PM EDT
Temp table, name suggest itself. it is used to stored data temparary.
for example if you want to store data temparary that is used only in current session like some calculation etc. in this we can use temp table.
hope this will help you.
Sanjeeb LenkaRank #301 · 8.3K reputationPosted Sep 11, 2013, 9:22 PM EDT
Temporary Tables
Temporary Tables provide short term use of data. Temporary Tables are created at run time and provide all the same functionality as a general table. Temporary Tables are created using # preceding the name of table. These tables are stored in a Tempdb database.
Use of Temporary Tables
There are several uses of Temporary Tables; some are the following:
refer to this link
http://www.c-sharpcorner.com/UploadFile/63f5c2/temporary-table-in-sql-server/
Jignesh TrivediRank #16 · 50.3K reputationPosted Sep 11, 2013, 11:47 PM EDT
Hi,
There are two type of Temporary tables: local and global. local temp table is visible only to their creators during the connection. local temp table are deleted after the user disconnect from instance of SQL server. global temp tables is visible to any user and any connection after they are created and it is deleted after when all users which referencing this table are disconnecting. In short life of temp table is very short.
Whereas Normal table is create parmemt and stored in users database. It is not automatically deleted.
Temp table is stored in master database.
hope this will help you.
vasanth krishna41 reputationPosted Sep 12, 2013, 6:41 AM EDT