title: Insert into ... Select *, how to ignore identity?
body: <p>I have a temp table with the exact structure of a concrete table <code>T</code>. It was created like this:  </p>
  
  <pre><code>select top 0 * into #tmp from T
  </code></pre>
  
  <p>After processing and filling in content into <code>#tmp</code>, I want to copy the content back to <code>T</code> like this:  </p>
  
  <pre><code>insert into T select * from #tmp
  </code></pre>
  
  <p>This is okay as long as <code>T</code> doesn't have identity column, but in my case it does. Is there any way I can ignore the auto-increment identity column from <code>#tmp</code> when I copy to <code>T</code>? My motivation is to avoid having to spell out every column name in the Insert Into list. </p>
  
  <p>EDIT: toggling identity_insert wouldn't work because the pkeys in <code>#tmp</code> may collide with those in <code>T</code> if rows were inserted into <code>T</code> outside of my script, that's if <code>#tmp</code> has auto-incremented the pkey to sync with T's in the first place. </p>