title: Specifying schema for temporary tables
body: <p>I'm used to seeing temporary tables created with just the hash/number symbol, like this:</p>
  
  <pre><code>CREATE TABLE #Test
  (
      [Id] INT
  )
  </code></pre>
  
  <p>However, I've recently come across stored procedure code that specifies the schema name when creating temporary tables, for example:</p>
  
  <pre><code>CREATE TABLE [dbo].[#Test]
  (
      [Id] INT
  )
  </code></pre>
  
  <p>Is there any reason why you would want to do this?  If you're only specifying the user's default schema, does it make any difference?  Does this refer to the <code>[dbo]</code> schema in the local database or the tempdb database?</p>