title: SQL Server BCP Utility incorrect data import
body: <p>I am using <a href="https://docs.microsoft.com/en-us/sql/tools/bcp-utility?view=sql-server-2017" rel="nofollow noreferrer">BCP utility</a> to import a <code>.csv</code> file. One of the columns has a value separated by comma but its enclosed in doubled quotes. BCP tools is unable to detect it and is incorrectly uploading data to my table. </p>
  
  <p>Here is a repro:</p>
  
  <pre><code>CREATE TABLE [dbo].[test_temptable]
  (
      --[ID] [int] IDENTITY(1,1) NOT NULL,
      [Column1] [varchar](100) NULL,
      [Column2] [varchar](100) NULL,
      [Column3] [varchar](100) NULL,
  
      /*PRIMARY KEY CLUSTERED ([ID] ASC)
  */
  ) 
  ON [PRIMARY]
  GO
  </code></pre>
  
  <p>Test data in <code>inputData.csv</code> file:</p>
  
  <pre><code>value1,"test,test",value3
  </code></pre>
  
  <p>When I run the bcp command it works</p>
  
  <pre><code>bcp "testDB.dbo.test_temptable" in  c:\temp\test\inputData.csv -c -t,  -T -S "testDBServer" -e c:\temp\test\error.csv
  
  1 rows copied.
  Network packet size (bytes): 4096
  Clock Time (ms.) Total     : 1      Average : (1000.00 rows per sec.)
  </code></pre>
  
  <p>However data in table is incorrect:</p>
  
  <p><a href="https://i.stack.imgur.com/W4FuU.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/W4FuU.png" alt="enter image description here"></a></p>
  
  <p>Column2 should have been <strong>test, test</strong> and column 3 <strong>value3</strong>.  </p>
  
  <p>What am I doing wrong? Any pointers? Thanks all. </p>