title: SqlBulkCopy performance
body: <p>I am working to increase the performance of bulk loads; 100's of millions of records + daily.  </p>
  
  <p>I moved this over to use the <code>IDatareader</code> interface in lieu of the data tables and did get a noticeable performance boost (500,000 more records a minute). The current setup is: </p>
  
  <ul>
  <li>A custom cached reader to parse the delimited files. </li>
  <li>Wrapping the stream reader in a buffered stream. </li>
  <li>A custom object reader class that enumerates over the objects and implements the <code>IDatareader</code> interface. </li>
  <li>Then <code>SqlBulkCopy</code> writes to server </li>
  </ul>
  
  <p>The bulk of the performance bottle neck is directly in <code>SqlBulkCopy.WriteToServer</code>. If I unit test the process up to but excluding just the <code>WriteToServer</code> the process returns in roughly 1 minute. <code>WriteToServer</code> is taking on an additional 15 minutes +. For the unit test it is on my local machine so the same drive the database lives on so it's not having to copy the data across the network. </p>
  
  <p>I am using a heap table (no indexes; clustered or unclustered; I have played around various batch sizes without major differences in performance). </p>
  
  <p>There is a need to decrease the load times so I am hoping someone might now a way to squeeze a little more blood out of this turn-up.    </p>