SSIS Excel数据源 - 是否可以重写列数据类型? [英] SSIS Excel Data Source - Is it possible to override column data types?

查看:290
本文介绍了SSIS Excel数据源 - 是否可以重写列数据类型?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当在SSIS中使用excel数据源时,每个列的数据类型都将从列中的数据派生出来。有可能重写这个行为吗?

When an excel data source is used in SSIS, the data types of each individual column are derived from the data in the columns. Is it possible to override this behaviour?

理想情况下,我们希望从excel源传递的每一列都是字符串数据类型,以便可以在以后的步骤中从源接收到的数据执行数据验证在数据流中。

Ideally we would like every column delivered from the excel source to be string data type, so that data validation can be performed on the data received from the source in a later step in the data flow.

目前,错误输出选项卡可用于忽略转换失败 - 所讨论的数据为空,并且程序包将继续执行。但是,我们想知道原始数据是什么,以便可以为该行生成适当的错误消息。

Currently, the Error Output tab can be used to ignore conversion failures - the data in question is then null, and the package will continue to execute. However, we want to know what the original data was so that an appropriate error message can be generated for that row.

推荐答案

是, 您可以。只需进入Excel源的输出列列表,并设置每个列的类型。

Yes, you can. Just go into the output column list on the Excel source and set the type for each of the columns.

要访问输入列列表,请右键单击Excel源,选择显示高级编辑器,单击标记为输入和输出属性的选项卡。

To get to the input columns list right click on the Excel source, select 'Show Advanced Editor', click the tab labeled 'Input and Output Properties'.

一个更好的解决方案是使用派生列组件,您可以在其中为Excel中的每个列实际构建新列。这具有以下优点:

A potentially better solution is to use the derived column component where you can actually build "new" columns for each column in Excel. This has the benefits of


  1. 您可以更好地控制您转换的内容。

  2. 您可以放置控制更改的规则(即如果null给我一个空字符串,但是如果有数据,那么给我的数据作为一个字符串)

  3. 你的数据源不直接绑定到其余的过程(即您可以更改来源,唯一需要做的工作的地方在派生列中)

这篇关于SSIS Excel数据源 - 是否可以重写列数据类型?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆