Question
BULK INSERT problem
I'm trying to import data from a csv file using the following
query:
BULK
INSERT HIGH_LOW
FROM 'C:\Documents and Settings\administrator\Desktop\e.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
but am getting errors like this:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (currencyPairID).
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 2 (currencyPairID).
Msg 4864, Level 16, State 1, Line 1
the csv file looks like this:
6,01/01/1999,1.4079,1.4079
6,04/01/1999,1.4153,1.3928
6,05/01/1999,1.4024,1.3985
6,06/01/1999,1.4276,1.3994
6,07/01/1999,1.4237,1.4096
6,08/01/1999,1.4215,1.4045
6,11/01/1999,1.4257,1.4132
And the table definition is
dataID int Unchecked Primary Key
currencyPairID int Checked
date datetime Checked
high float Checked
low float Checked
Thanks for any advice you can give me 🙂
BULK
INSERT HIGH_LOW
FROM 'C:\Documents and Settings\administrator\Desktop\e.csv'
WITH
(
FIELDTERMINATOR = ',',
ROWTERMINATOR = '\n'
)
GO
but am getting errors like this:
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 1, column 2 (currencyPairID).
Msg 4864, Level 16, State 1, Line 1
Bulk load data conversion error (type mismatch or invalid character for the specified codepage) for row 2, column 2 (currencyPairID).
Msg 4864, Level 16, State 1, Line 1
the csv file looks like this:
6,01/01/1999,1.4079,1.4079
6,04/01/1999,1.4153,1.3928
6,05/01/1999,1.4024,1.3985
6,06/01/1999,1.4276,1.3994
6,07/01/1999,1.4237,1.4096
6,08/01/1999,1.4215,1.4045
6,11/01/1999,1.4257,1.4132
And the table definition is
dataID int Unchecked Primary Key
currencyPairID int Checked
date datetime Checked
high float Checked
low float Checked
Thanks for any advice you can give me 🙂