I'm trying to insert a .csv
file into an existing table. The existing table has 3 columns and these are IDs (just being assigned in the table), Student Number, and Group Number.
In my .csv
, I have the format below, but every time I insert it, I get an error
The bulk load failed. Unexpected NULL value in data file row, column 1. The destination column (ID) is defined as NOT Null.
So how do I ignore the first column?
This is the .CSV
file:
ID,StudentNumber,GroupNumber
,0000123456,3
,0000794613,3
The SQL that I'm using
BULK INSERT [dbo].[Table_StudentNumber]
FROM 'E:\CSV\sample.csv'
WITH
(
FIRSTROW = 2,
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
);