Failed package at data conversion

  • I have a data source is a flat file, and I need to import it into a table with a column data tpe is int, null.

    [Data Conversion [361]] Error: Data conversion failed while converting column "PerID " (14) to column "cvtPerID" (371). The conversion returned status value 2 and status text "The value could not be converted because of a potential loss of data.".

    I keep getting errors when converting the data type.

    I guess it is from blank strings, I did check return null values, but it is not working.

    what should I use in ssis expressions to make the conversion successful and load the table?

    Thanks

  • Hi sqlfriends,

    1. If the NULLs are denoted by empty values, then set the "Retain NULL values setting" by checking on the check box in the Flat File source in the DFT.

    2. If they are denoted as NULL in the falt file, you can use the ISNULL function as

    ISNULL([PerID]) ? NULL(DT_I4) : [PerID]

    Hope this helps.

    Thanks.

  • sekalps (1/5/2012)


    Hi sqlfriends,

    1. If the NULLs are denoted by empty values, then set the "Retain NULL values setting" by checking on the check box in the Flat File source in the DFT.

    2. If they are denoted as NULL in the falt file, you can use the ISNULL function as

    ISNULL([PerID]) ? NULL(DT_I4) : [PerID]

    Hope this helps.

    Thanks.

    Thanks a lot sekalps.

    In the flat file, I can see some of the values in that column is blank, so I think it is denoted by empty values. There are no values like the word Null in the flat file.

    So I did try the no 1 option earlier , that is to check "Retain NULL values as null values from source as null in the data flow" by checking on the check box in the Flat File source in the DFT.

    But I don't understand why it still give above error.

    No 2 option you suggested is not our case.

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

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