SSIS表达式 [英] SSIS expression

查看:227
本文介绍了SSIS表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都知道为什么这个SSIS表达式不起作用



派生列名称为 from_service_date_yyyymmdd



表达式是

 (DT_STR,4,1252)from_service_date_yyyy + RIGHT (0+(DT_STR,2,1252)from_service_date_mm,2)+ RIGHT(0+(DT_STR,2,1252)from_service_date_dd,2)

from_service_date_yyyy from_service_date_mm from_service_date_dd 都具有有效值



派生列转换的输出没有 from_service_date_yyyymmdd 。我不知道为什么。

解决方案

你的表情看起来不错,但是你错过了列名中的方括号,而你由于 RIGHT() DT_WSTR 而不是 DT_STR c>函数结果是键入 DT_WSTR ,并将整个结果转换为 DT_DTR 如果需要



(DT_WSTR,8,1252)((DT_WSTR,4)[from_service_date_yyyy] + RIGHT(0+
(DT_WSTR,2)[from_service_date_mm],2) + RIGHT(0+
(DT_WSTR,2)[from_service_date_dd],2))


Anybody have any idea why this SSIS expression is not working

The derived column name is from_service_date_yyyymmdd

The expression is

(DT_STR,4,1252)from_service_date_yyyy + RIGHT("0" + (DT_STR,2,1252)from_service_date_mm,2) + RIGHT("0" + (DT_STR,2,1252)from_service_date_dd,2)

from_service_date_yyyy, from_service_date_mm and from_service_date_dd all have valid values

The output from the derived column transformation does not have from_service_date_yyyymmdd. I can't figure out why.

解决方案

your expression looks fine, but you missed the brackets in the columns names, and you have to cast columns to DT_WSTR instead of DT_STR because RIGHT() function result is of type DT_WSTR, and cast the whole result to DT_DTR if needed

(DT_WSTR,8,1252)((DT_WSTR,4)[from_service_date_yyyy] + RIGHT("0" + 
(DT_WSTR,2)[from_service_date_mm],2) + RIGHT("0" + 
(DT_WSTR,2)[from_service_date_dd],2))

这篇关于SSIS表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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