SSIS - Leading zeros omitted from OLEDB source to Flat FIle Destination Connect

  • Hi,

    I am trying to export the data from OLEDB source connection to Flat FIle destination (.CSV) and for the SSN field which character length 9 is omitting leading zeros

    after the data load. Please let me know the correct soultion.

    Original Data: 001234567

    Required Data: 001234567

    Omitted Data with leading zero's issue: 1234567

    I have used data conversion by converting it to STR and WSTR and also derived column with below code but still having the same iisue.

    Derived COlumn Logic: RIGHT(REPLICATE("0",9) + SSN,9) or RIGHT("000000000" + [Copy of SSN],9)

    Appreciate if anyone can help resolve te issue.

    Thanks,

    Sandeep

  • Sandy2024 wrote:

    the SSN field which character length 9 is omitting leading zeros after the data load

    What do you meant 'after the data load'?

    How are you looking at the csv file?

    I suspect if you look at the csv with something like notepad you will find the leading zeros. If you are opening the csv with Excel it will remove the leading zeros by converting the string to an integer. This is the way Excel works and is nothing to do with how the csv is created.

     

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

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