在數據源組件中,如果存在字符串類型的數據列,那麼可能會存在,因為字符類型的長度不匹配,導緻字符數據被截斷的問題。
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。
,更多精彩资讯请关注tft每日頭條,我们将持续为您更新最新资讯!