I am trying to load an SQL Server table from a CSV file.
My Bulk Insert statement:
bulk insert ClassList from 'ClassList.csv'
with (
firstrow=2,
fieldterminator=',',
maxerrors=100,
keepnulls
);
Most of the data loads but not the few rows where one of the fields contains a comma so they have double quote delimiters - here rows 21 & 23 load but not 22:
21,Blue or Lilac Smoke Adult,22,PER,
22,"Red, Tortie, Cream, Blue or Lilac Cream or Choc. Tortie Smoke Adult",23,PER,
23,AC Silver Tabby Adult,24,PER,
My table:
Class_Number varchar(10) not null
Class_Description varchar(200) not null
Class_Order int not null
Section_ID varchar(10) not null
Judge_Initials varchar(10) null
Using SSMS v17.2.
SQL Server details:
Product Version: 13.0.4206.0
Product Name: SQL Server 2016
Product Level: SP1
Product Edition: Express Edition (64-bit)