title: Insert .csv file into SQL Server table
body: <p><strong>Background:</strong></p>
  <p>I have a table named dbo.table, within my database Data. I then have a .csv file  named test.csv I would like to push this test.csv data into my dbo.table within my Data database. How would I go about doing this?</p>
  <pre><code>  dbo.table
  
    State    Customer
    Ga       John Doe
  
  
    test.csv
  
    State    Customer 
    NY       Carolyn King
  </code></pre>
  <p><strong>Desired Output:</strong></p>
  <pre><code>State    Customer
  Ga       John Doe
  NY       Carolyn King
  </code></pre>
  <p>I wish to insert test.csv data into the dbo.table.
  I am currently doing a Bulk Insert:</p>
  <pre><code>BULK INSERT dbo.table
  FROM 'C:\test.csv'
  WITH  
       (
     FIRSTROW = 2,
     rowterminator='\n',
     fieldterminator=',',
     tablock
       );
  </code></pre>
  <p>However, how would I perform this with a regular Insert query?</p>
  <p>Could I do:</p>
  <pre><code>  INSERT INTO dbo.table SELECT a.* FROM
    OPENROWSET 
            (BULK N'D:\data.csv', FORMATFILE =
             'C:\test.csv', CODEPAGE = '65001');
  </code></pre>
  <p>I am unsure of the CODEPAGE....</p>