title: TSQL BULK INSERT row errors cause C# exceptions
body: <p>I am processing extremely large delimited files.  These files have been pre-processed to ensure that field and row delimiters are valid.  Occasionally a row is processed that fails TSQL constraints (usually a datatype issue).  'Fixing' the input data is not an option in this case.</p>
  
  <p>We use <code>MAXERRORS</code> to set an acceptable number of input errors and <code>ERRORFILE</code> to log failed rows.</p>
  
  <p>The bulk insert completes in SSMS with severity level 16 error messages logged to the messages window for each failed row.  Attempting to execute this code via the C# <code>SqlCommand</code> class causes an exception to be thrown when the first severity level 16 error message is generated, causing the batch to fail.</p>
  
  <p>Is there a way to complete the operation and ignore SQL error messages via C# and something like SqlCommand?</p>
  
  <p>Example Command:</p>
  
  <pre><code>BULK INSERT #some-table FROM 'filename' 
  WITH(FIELDTERMINATOR ='\0',ROWTERMINATOR ='\n',FIRSTROW = 2, MAXERRORS = 100, ERRORFILE = 'some-file')
  </code></pre>