title: SQL Server SELECT INTO and Blocking With Temp Tables
body: <p>So, recently a DBA is trying to tell us that we cannot use the syntax of</p>
  
  <pre><code>SELECT X, Y, Z
  INTO #MyTable
  FROM YourTable
  </code></pre>
  
  <p>To create temporary tables in our environment, because that syntax causes a lock on TempDB for the duration of the stored procedure executing.  Now, I've found a number of things that detail how temporary tables work, scope of execution, cleanup and the like.  But for the life of me, I don't see anything about blocking because of their use.</p>
  
  <p>We are trying to find proof that we shouldn't have to go through and do CREATE TABLE #MyTable... for all of our temporary tables, but neither side can find proof.  I'm looking for any insight SO people have.</p>
  
  <p><em>Additional Information</em></p>
  
  <p>Currently working with SQL Server 2005, and soon to be SQL Server 2008  (Enterprise editions)</p>