XuanYi Leon
XuanYi Leon

Reputation: 41

Bulk load data conversion error from csv file to SQL

I have this problem inserting my data from csv file to my SQL database. I just don't get it why there is a error when i already replace some unwanted characters. it should be able to insert but i got this error.

"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 13 (creditLimit)."

this is my create table:

CREATE TABLE Customers(
    customerNumber integer NOT NULL,
    customerName varchar(50) NOT NULL,
    customerLastName varchar(50) NOT NULL,
    customerFirstName varchar(50) NOT NULL,
    Phone varchar(50) NOT NULL,
    addressLine1 varchar(50) NOT NULL,
    addressLine2 varchar(50) NULL,
    city varchar(50) NOT NULL,
    [state] varchar(50) NULL,
    postalCode varchar(15) NOT NULL,
    country varchar(50) NOT NULL,
    salesRepEmployeeNumber integer NOT NULL,
    creditLimit double precision NOT NULL
    PRIMARY KEY(customerNumber) );

this is the first few lines of my csv file:

first line- 103,Atelier graphique,Schmitt,Carine ,40.32.2555,54 rue Royale,NULL,Nantes,NULL,44000,France,1370,21000

second line- 112,Signal Gift Stores,King,Sue,7025551838,8489 Strong St.,NULL,Las Vegas,NV,83030,USA,1166,71800

im not sure why is there error can you please help me?

Upvotes: 4

Views: 792

Answers (1)

PrfctByDsgn
PrfctByDsgn

Reputation: 1050

I think it's because your rowterminator is wrong ... you should use \n not /n ...

Upvotes: 1

Related Questions