简体   繁体   English

使用SSIS将数据导出到CSV导致数据类型更改

[英]Export Data to CSV using SSIS causing datatype changed

I have a SSIS package to export the table datas to CSV. 我有一个SSIS包,用于将表数据导出到CSV。 However I have a string column with values '000' and '001' and '004'. 但是我有一个字符串列,其值是'000'和'001'和'004'。 When I am writting into the CSV using FlatFile connection the values are changed to 0,1 and 4. 当我使用FlatFile连接写入CSV时,值更改为0,1和4。

However I have mentioned the columns as DT_STR with length of 3. 但是我提到的列为DT_STR,长度为3。

Could anyone help me to print the values as string.? 有人可以帮我将值打印为字符串吗?

I am totally clueless. 我完全一无所知。

Regards, saravanakumar 问候,saravanakumar

This problem is due to the representation in Excel. 此问题是由于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. 解决方案是在另一个文本编辑器中打开文档,或者需要在excel中打开文档,然后使用excel目标。 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. 另一种解决方案是在csv中将值生成为公式,例如=“ 001”,=“ 002” ...等,因为在excel中打开时,这将保留前导零。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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