将DDMonYY和时间转换为SSIS包中的datetime列(派生列) [英] Convert DDMonYY and time to datetime column in SSIS package (Derived Column)
问题描述
我有以下数据:
12APR19 0644
,我想在SSIS中对它们进行组合/转换,以便它们在我的最终目的地中显示为:
12APR19 0644
and I want to combine/transform these in SSIS so they appear in my final destination as:
2019-04-12 06:44:00.00
我尝试使用(DT_DBTIMESTAMP)[DateColumn] [TimeColumn]
,但这给了我一个一般性错误.有人帮忙吗?
I've tried using (DT_DBTIMESTAMP) [DateColumn] [TimeColumn]
but this gives me a generic error. Anyone help please?
推荐答案
首先将您的字符串转换为dd mmm yyyy hh:mm,然后使用大小写类型dt_date:
First transform your string to dd mmm yyyy hh:mm then use the type case dt_date:
(DT_DATE)"12 APR 2019 06:44"
返回:
4/12/2019 6:44:00 AM
4/12/2019 6:44:00 AM
您可以进一步转换以获得所需的格式.OTOH如果您的目标是SQL Server数据库,则可以执行以下操作:
which you can further transform get the format you want. OTOH if your destination is a SQL Server database, you can do:
(DT_WSTR, 20)(DT_DBTIMESTAMP)"12 APR 2019 06:44"
产生
2019-04-12 06:44:00
2019-04-12 06:44:00
这篇关于将DDMonYY和时间转换为SSIS包中的datetime列(派生列)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!