SSIS Trimming Leading Zero (Stumped)

  • Hi all

    I am using SSIS to pull data from one database into another on different servers and I am running into a problem that has me stumped.

    My Oledb source is executing a Stored Procedure that returns an ID VARCHAR(8). Example 01000003.

    My oledb destination is set to fast load into a table that has an ID field VARCHAR(8).

    Very simple source to destination data flow.

    When I run the package the SSIS destination seems to be dropping the leading zero and I don't know why, so the value being inserted is 1000003. I need the leading zero to be retained but don't know how to do this.

    I have checked the advanced editor, the mappings are correct, the datatyp is string[DT_STR] length 8.

    Any ideas or solutions would be most appreciated.

    Thanks

    Matt

  • Ah SSIS,

    Ok so I came right. It was, at the end of the day, something to do with the metadata for the destination table. SSIS didn't like the table I had created in SSMS, so I created the table via the OLEDB destination component and voila, all fixed.

  • Thanks for posting what you found. I don't know much about SSIS and every bit helps.

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

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

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