SSIS 数据输出列因为字符截断而失败

在数据源组件中,如果存在字符串类型的数据列,那么可能会存在,因为字符类型的长度不匹配,导致字符数据被截断的问题。

SSIS报错信息:“Text was truncated or one or more characters had no match in the target code page.".

 

第一种scenario是修改Output Columns的Data Type Properties。

打开Advanced Editor,选中Input and Output Properties,在Output Columns中选中要修改的Column,修改Data Type Properties的length,增加长度。

 

第二种scenario,SSIS提供TruncationRowDisposition属性,可以设置RD_IgnoreFailure选项,使数据源对字段过长的数据自动进行截断而不报错。

TruncationRowDisposition,Specifies how the component handles rows with truncations.

SSIS处理数据源中列值的Truncation有三种方式:

RD_FailComponent,如果出现列值Truncation,那么数据源组件就失败;

RD_RedirectRow,如果出现列值Truncation,那么将该数据行重定向到ErrorOutput;

RD_IgnoreFailure,忽略错误,将列值Truncate,并将截断后的数据向下传递,类似于sql语句中的left(ouput_column,length)

 

设置TruncationRowDisposition=RD_IgnoreFailure,类似于在输出列上应用left函数

left( Output_Column_Name, Lenght),Length是在Data Type Properties中设置的Length。

 

转载来源:https://www.cnblogs.com/ljhdo/p/4811081.html

posted @ 2019-01-23 15:41  JinweiChang  阅读(345)  评论(0编辑  收藏  举报