Invalid character converting Null for DateTime field

  • I am receiving the following error:

    Error: 0xC020901C at Data Flow Task, OLE DB Destination [1695]: There was an error with input column "oShipDate" (1831) on input "OLE DB Destination Input" (1708). The column status returned was: "The value could not be converted because of a potential loss of data.".

    I think I narrowed the problem, importing from a text file and when the field oShipDate is null it throws the above error, if I change the field to varchar it imports fine so here is my question I

    am using the Script Component (Transformation) and in the script I have:

    Row.oShipDate = Row.ShipDate

    how do I check to see if Row.ShipDate (input field from text) is null?

    Tried If row.shipdate is null but apparently this is not supported.

  • Check below link on ...How to add NULL Defense to your SSIS packages using scripting

    it might help you

    http://www.mssqltips.com/tip.asp?tip=2044

  • I went back to my flat file and instead of ShipDate being a string I made it Date and same in the Script Transformation but I come to the script and do :

    If Row.ShipDate_isnull then

    Row.oShipDate = dbnull.value

    End If

    But for the dbnull.value I get value of type system.DBnull can not be converted to date.

    Any other ideas?

    Thanks!

Viewing 3 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic. Login to reply