title: How tempDB works?
body: <p>I am trying to understand the <code>tempDB</code> and following are the doubts popping in my mind.</p>
  
  <ol>
  <li>What is the lifetime of data in <code>tempDB</code>? Say a query is doing some <code>Order By</code> and uses <code>tempDB</code> for performing that. After this query finishes, someone else also executes a query which utilizes the <code>tempDB</code>. Will the second query find records written by first query in the <code>tempDB</code> or will they be deleted?</li>
  <li>Are there any <strong><em>visible</em></strong> tables created inside the <code>tempDB</code> by the Sql Engine? How can I know which temporary table is created because of this query? Is there any naming convention followed by the Sql engine for naming these temporary tables?</li>
  </ol>
  
  <p>I am new to <code>tempDB</code> so please pardon me for asking such silly (if at all) questions :-)</p>
  
  <p><em>It will be very nice if someone can point me to a good resource which can help me learn about tempDB.</em></p>