we are trying to transfer data from DB2 -> SQL Server 2014 database with identical schema with column types translated like db2 Timestamp mapped to sql server Datetime2 type. When using SSIS to transfer data between tables, the timestamp -> datetime2
is failing due to data type mismatch in SSIS.
Found couple of old links related to that and they had below suggestions,
1) One suggesting to use below expression,
(SSIS-derived column) code for the transformation:
SUBSTRING(<TimestampColumn>,1,10) + " " + SUBSTRING(<TimestampColumn>,12,2)+ ":" + SUBSTRING(<TimestampColumn>,15,2) + ":" + SUBSTRING(<TimestampColumn>,18,2) + "." + SUBSTRING(<TimestampColumn>,21,26)
Is this approach valid and if so is the <TimestampColumn> in the above expression is it in DB2 Timestamp type or it is the string version of db2 TimestampColumn?
2) another blog suggesting to add a derived column and Type cast it with (DT_DBTIMESTAMP2)[Column_Name],.
again, in above not sure if above expects the source DB2 timestamp data in String format or will work on Timestamp type?
Please share how to handle this Timestamp -> Datetime2 mismatch in SSIS.
regards
aravias