Click here to Skip to main content
15,888,320 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
XML
USE TEST
GO

/****** BULK INSERT  ******/
BULK
INSERT [test]
FROM 'C:\emp.csv'
WITH
(
FIRSTROW = 1,
FIELDTERMINATOR = '|',
ROWTERMINATOR = '\n'
)
GO
/****** End ******/


Msg 4864, Level 16, State 1, Line 3
Bulk load data conversion error (type mismatch or invalid character for the specified codepage)


I am using the above script, however the data is uploading 100% but the arabic data consist of invalid characters.
البنك
الأهلي
التجاري


Please advise.

With Best Regards
Posted
Updated 14-Aug-19 22:42pm
v2
Comments
Sergey Alexandrovich Kryukov 5-Aug-15 3:35am    
What are your character/text data types?
—SA
Kornfeld Eliyahu Peter 5-Aug-15 4:41am    
What is the default collation of your SQL?

column definition must be Nvarchar
 
Share this answer
 
Hi Dear the problem in the file coding 'text file ' the default coding is ANSI
change it to unicode and save it, Thanks.
ENG. Shaker.
 
Share this answer
 
Comments
CHill60 15-Aug-19 5:09am    
As the OP refers to "the Arabic data" they presumably can see the data fine in the csv file they are uploading.
It is the uploaded data that is wrong, which is not affected by changing the encoding of a text file.
Solution 1 from 2015 is correct - the receiving Column on the database must be capable of storing Unicode characters - i.e. it must be defined as NVARCHAR (or NCHAR).
Your solution is incorrect

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900