title: What's the fastest way to INSERT loads of data from one table to another? (SQL Server 2005)
body: <p>I'm basically trying to copy data from a table in one database in SQL Server 2005 to another table, with the same structure (but lots of indexes) in another database in the same SQL Server instance.</p>
  
  <p>My current approach is the obvious INSERT/SELECT:</p>
  
  <pre><code>set identity_insert TargetDBName.dbo.TableName on
  
  insert into TargetDBName.dbo.TableName ([FieldsList])
    select [FieldsList] from  TargetDBName.dbo.TableName    
  
  set identity_insert SourceDBName.dbo.TableName off
  </code></pre>
  
  <p>Which takes, approximately, forever (1 hour for 10 million records, while it took 20 minutes to do it from the table with indexes to the one without them).</p>
  
  <p>What's the best way to do this?</p>
  
  <p>Thanks!</p>