title: Conditional BULK INSERT for CSV files with different number of columns in SQL Server
body: <p>I've generated a BCP FORMAT FILE (xml) for importing a CSV file into a SQL SERVER table.  There are 100+ CSV files (representing IIS web logs).  Some sites collect 5 columns of data, and some sites collect 6 columns of data.  The first five columns are the same.</p>
  
  <p><strong>Is there anyway I can check first how many columns the CSV file has BEFORE I do the BULK INSERT command?</strong>  That way, I can choose the correct format file to use with the command without getting an error stating columns are missing.</p>