title: C# - Inserting multiple rows using a stored procedure
body: <p>I have a list of objects, this list contains about 4 million objects. there is a stored proc that takes objects attributes as params , make some lookups and insert them into tables.</p>
  
  <p>what s the most efficient way to insert this 4 million objects to db?</p>
  
  <p>How i do :</p>
  
  <pre><code>-- connect to sql - SQLConnection ...
  
  foreach(var item in listofobjects)
  {    
     SQLCommand sc = ...
  
     // assign params
  
     sc.ExecuteQuery();    
  }
  </code></pre>
  
  <p>THis has been really slow.</p>
  
  <p>is there a better way to do this?</p>
  
  <p>this process will be a scheduled task. i will run this ever hour, so i do expect high volume data like this.</p>