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.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh TrivediPosted Sep 13, 2013, 12:00 AM
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.
vasanth krishnaPosted Sep 12, 2013, 10:41 AM
Jignesh TrivediPosted Sep 12, 2013, 3:47 AM
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.
Sanjeeb LenkaPosted Sep 12, 2013, 1:22 AM
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/