title: SQL Server Bulk insert of CSV file with inconsistent quotes
body: <p>Is it possible to BULK INSERT (SQL Server) a CSV file in which the fields are only OCCASSIONALLY surrounded by quotes? Specifically, quotes only surround those fields that contain a ",".</p>
  
  <p>In other words, I have data that looks like this (the first row contain headers):</p>
  
  <pre><code>id, company, rep, employees
  729216,INGRAM MICRO INC.,"Stuart, Becky",523
  729235,"GREAT PLAINS ENERGY, INC.","Nelson, Beena",114
  721177,GEORGE WESTON BAKERIES INC,"Hogan, Meg",253
  </code></pre>
  
  <p>Because the quotes aren't consistent, I can't use '","' as a delimiter, and I don't know how to create a format file that accounts for this.</p>
  
  <p>I tried using ',' as a delimter and loading it into a temporary table where every column is a varchar, then using some kludgy processing to strip out the quotes, but that doesn't work either, because the fields that contain ',' are split into multiple columns.</p>
  
  <p>Unfortunately, I don't have the ability to manipulate the CSV file beforehand.</p>
  
  <p>Is this hopeless?</p>
  
  <p>Many thanks in advance for any advice.</p>
  
  <p>By the way, i saw this post <a href="https://stackoverflow.com/questions/96448/sql-bulk-import-from-csv">SQL bulk import from csv</a>, but in that case, EVERY field was consistently wrapped in quotes. So, in that case, he could use ',' as a delimiter, then strip out the quotes afterwards.</p>