简体   繁体   中英

Export Data to CSV using SSIS causing datatype changed

I have a SSIS package to export the table datas to CSV. However I have a string column with values '000' and '001' and '004'. When I am writting into the CSV using FlatFile connection the values are changed to 0,1 and 4.

However I have mentioned the columns as DT_STR with length of 3.

Could anyone help me to print the values as string.?

I am totally clueless.

Regards, saravanakumar

This problem is due to the representation in Excel. The solutions are either opening the document in another text editor or if it is required to open it in excel, then use an excel destination. An alternative solution is to generate the values in the csv as formulas, eg ="001",="002"... etc. as this will keep the leading zeros when opening in excel.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM