1
votes

I have one CSV file that file contains empname & emp joining date. All the text in the CSV file are in chinese language. Example

中国上汽,2008年12月18日
中国石油,2008年12月18日

I want to read this datetime column and insert it into SQL table using SSIS package. Am getting below error message

[OLE DB Destination [9]] Error: There was an error with input column "工资结束期" (85) on input "OLE DB Destination Input" (22). 
The column status returned was: "The value could not be converted because of a potential loss of data.".
1
The error is on Destination element, show what type of column and size is in sql table and what data type and size 工资结束期 column is. My guess would be that you trying insert bigger size column in smaller sql table column...Justin

1 Answers

0
votes

My guess would be that you trying insert bigger size column in smaller sql table column. If yes you got 2 options:

  1. Make bigger sql table column
  2. Make smaller column from CSV file.

Second option you can do inserting 'Derived column' element and adding new column with old column substring (something like this):

SUBSTRING(工资结束期, 1, 22)

EDIT

You can use Derived column element on date:

(DT_DBDATE)(SUBSTRING("2008年12月18日",1,4) +"-"+ SUBSTRING("2008年12月18日",6,2)
+ "-" + SUBSTRING("2008年12月18日",8,2))

Just change "2008年12月18日" to your column.