[派生列[40]]错误:尝试执行类型转换时发生错误

时间:2012-08-29 12:11:25

标签: sql-server-2008 ssis

我在Sql Server中用IsNull条件写了日期和时间列查询..我在下面提到了这个查询..

我希望那个查询是,如何编写ssis派生列。我已经在ssis中编写了该查询,但是出现了一些类型错误..

这里连接日期和时间列。

请帮助我,

Sql Query ---

CAST(ISNULL(CONVERT(Nvarchar(10),InitialDate,101), '01/01/1900')  AS Nvarchar(10))+ ' ' + ISNULL(CONVERT(NVarChar(8),InitialTime,108), '00:00:00')   as  CourtDttm

SSIS派生专栏

(DT_DBTIMESTAMP)((DT_STR,255,1252)(ISNULL(InitialDate) ? ((DT_DBTIMESTAMP)"01/01/1900") : (InitialDate)) + " " +
((DT_STR,255,1252)(ISNULL(InitialTime) ? ((DT_DBTIMESTAMP)"00 : 00 : 00") : (InitialTime))))


Errors --[Derived Column [40]] Error: An error occurred while attempting to perform a type cast.

1 个答案:

答案 0 :(得分:0)

我认为你在寻找:

DT_DBDATE - A date structure that consists of year, month, and day.

DT_DBTIME - A time structure that consists of hour, minute, and second.

如果您使用DT_DBTIMESTAMP,则必须像填写InitialDate一样填写日期部分。

相关问题