Check your CSV file to see if it contains extra columns and/or delimiter characters on the affected lines.
Consider the following CSV example:
Foo,Bar,Baz
1,2,
1,2,,
1,2,3
1,2,3,
1,2,3,4
1,2,3,4,
1,2,3,4,5
1,2,3,4,5,
When reading it into a table with the following SQL code:
use tempdb
go
drop table if exists my_table;
go
create table my_table (
[First] varchar(10),
[Second] varchar(10),
[Third] varchar(10)
);
go
BULK INSERT my_table FROM 'C:\Temp\example.csv' WITH (
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n',
FIRSTROW = 2
);
select * from my_table;
go
It will yield the following imported results:
First |
Second |
Third |
1 |
2 |
NULL |
1 |
2 |
, |
1 |
2 |
3 |
1 |
2 |
3, |
1 |
2 |
3,4 |
1 |
2 |
3,4, |
1 |
2 |
3,4,5 |
1 |
2 |
3,4,5, |