Click here to Skip to main content
15,897,891 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i copied a table into a textfile from a remote server, part of the copied record is shown below;

마가00190718
마가00190718

I then, copy the textfile into my local server table using "Bulk Inset",
I could not continue with the "Bulk Insert" because an error appears,
----
Bulk load data conversion error (truncation) for row 461, column 10 (Ref). Bulk load data conversion error (truncation) for row 462, column 10 (Ref). Bulk load data conversion error (truncation) for row 463, column 10 (Ref). Bulk load data conversion error (truncation) for row 4521, column 10 (Ref). Bulk load data conversion error (truncation) for row 5210, column 10 (Ref). Bulk load data conversion error (truncation) for row 5357, column 10 (Ref).
----
The special character(Korean Letter), gives me the error.

How can i prevent this or what will i do with?
Posted
Comments
manognya kota 18-Jan-12 23:58pm    
did you open that text file in notepad after you copied from the remote server?
Alan Tuscano 19-Jan-12 0:03am    
Nope.

inside the process which i do is access a table form a remote server, i then copy that table into a textfile in my local server, from there, i then copy the textfile via "BULK INSERT" into my local server TABLE.

I only opened the textfile, after the error appeared, to see whats cuasing my the error, and i found that(the recorsd with Korean Letters).

I checked on the source table, and the same format exist as a record.

What kind of datatype are you using for that column? The nvarchar(size) datatype stores unicode characters, so should work.
 
Share this answer
 
Comments
Alan Tuscano 19-Jan-12 0:13am    
Yes Sir, the datatype is nvarchar(10)

Target Table
column name data type allows null
ref nvarchar(10) [] <- yes

Same structure with the source table
strSQL = "BULK INSERT mbmis..GLTRNHIST " & _
"FROM [" & rTxtFileDir & "\dGLTxnUpload.txt] " & _
"WITH (CODEPAGE = 65001, FIELDTERMINATOR = '|', ROWTERMINATOR = '\n' )"

CODEPAGE = 65001 ---> represents Unicode(UTF-8)
This is because, the records contains special Characters (Korean Letters)
 
Share this answer
 

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