RATE THIS ANSWER
+1
Click to Vote:
1
0
Here is an excellent technet article that should give you all the information you are looking for.
----------
The basic summary of tempdb is that it's used for temporary objects. Temp tables, table variables, when SQL Server needs to stage data into a database for sorting data, doing joins in a hash table, etc it's all done within the tempdb database.
Each time the SQL Service is restarted the tempdb database is deleted and recreated as an empty database.
*****************************************************
TemDB in SQL Server is the area where all temporary information is stored. It consists of log files based on various transactions taking place in the database. Like MasterDB contains Master Database data, this contains temporary data. The log files need to be flushed on regular basis and don’t forget to Shrink TempDB to bring it back to actual size after flushing temp log files otherwise it will keep on utilizing the White Space.