title: Insert Multiple Rows Into Temp Table With SQL Server 2012
body: <p>These StackOverflow questions <a href="https://stackoverflow.com/questions/452859/inserting-multiple-rows-in-a-single-sql-query">here</a>, <a href="https://stackoverflow.com/questions/2676493/insert-multiple-rows-into-temp-table-with-one-command-in-sql2005">here</a>, and <a href="https://stackoverflow.com/questions/2624713/how-do-i-insert-multiple-rows-without-repeating-the-insert-into-dbo-blah-part">here</a> all say the same thing, but I can't get it to run in SSMS or SQLFiddle</p>
  
  <pre class="lang-sql prettyprint-override"><code>CREATE TABLE #Names
    ( 
      Name1 VARCHAR(100),
      Name2 VARCHAR(100)
    ) 
  
  INSERT INTO #Names
    (Name1, Name2)
  VALUES
    ('Matt', 'Matthew'),
    ('Matt', 'Marshal'),
    ('Matt', 'Mattison')
  </code></pre>
  
  <p>When I execute this is SSMS, the insert fails with the following message on the first line after <code>VALUES</code></p>
  
  <blockquote>
    <p>Msg 102, Level 15, State 1, Line 10<br>
    Incorrect syntax near ','.</p>
  </blockquote>
  
  <p>This <a href="http://sqlfiddle.com/#!18/32d8f/1" rel="noreferrer"><strong>Fiddle</strong></a> runs without the <code>#</code> sign, and the schema executes successfully when the table name is <code>#Names</code>, but I get the following message when I try to select * from the table </p>
  
  <blockquote>
    <p>Invalid object name '#NAMES'.: SELECT * FROM #NAMES</p>
  </blockquote>
  
  <p>Does SQL Server 2012 support multiple inserts?</p>
  
  <hr>
  
  <p><strong>Update</strong>: Apparently accessing a 2005 server on SSMS 2012....</p>
  
  <pre class="lang-sql prettyprint-override"><code>SELECT @@VERSION --Returns: Microsoft SQL Server 2005
  </code></pre>