The value is a datetime2 type. SSISAFAIK does not support datetime2. You need to save it in the database as a row, and then update the column by translating it to datetime2.
Here is the problem with Microsoft Connect
Update. Using DT_DBTIMESTAMP2 , you can convert the string to the appropriate date and time format
Below code works fine in Derived Column
(DT_DBTIMESTAMP2,7)"2013-5-27 16:42:37.490000"
7 is the precession here. The above code will not work if the datetime format is different. For example, MM/DD/YYYY HH:mm:ss.ffffff .
However, you can use the Script component and pass an array of different datetime formats to the Datetime.ParseExact function
Step1: Drag the Script component and create a new DT_DBTIMESTAMP datatype output column and name it NewDate .
Step 2: write below C # code
public override void Input0_ProcessInputRow(Input0Buffer Row) { string[] format = new string[] { @"M/dd/yyyy HH:mm:ss.ffffff", @"MM/dd/yyyy HH:mm:ss", @"M/d/yyyy HH:mm:ss" , @"M/dd/yyyy HH:mm:ss.ffffff", @"MM/dd/yyyy HH:mm:ss.ffffff", @"M/d/yyyy HH:mm:ss.ffffff"}; DateTime dt = DateTime.ParseExact(Row.Date, format , CultureInfo.InvariantCulture, DateTimeStyles.None); Row.newDate = dt; }
source share