SSIS expression

只谈情不闲聊 提交于 2020-02-24 12:31:06

问题


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.


回答1:


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))


来源:https://stackoverflow.com/questions/43332470/ssis-expression

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!