Lookup task

  • I have a ssis, I would like to do an incremental Add records load.

    I first use a lookup task to check in the table if there are matched records of primary key, I have 3 columns is prirmay key, so in the column mapping in lookup task, I link those 3 columns in the available input columns and lookup columns.

    Then point the no match records link to the OLEDB destination.

    The first time load is correct. But when doing the second time load, I didn't change the source file, it is supposed to load 0 records, but I still get a lot of records, that are not matching.

    what I do wrong here?

    Thanks

  • I'm guessing embedded spaces. The lookup is VERY sensitive to this and it drives me crazy.. Filter out the spaces before the lookup because they are probably not persisted in the table.

    CEWII

  • Thanks, I think I identified the column is a char(30) named allocationType.

    It caused the mistmatch, although the data look exactly the same from input and table.

    The value is not a fixed 30 character length, but it can be less than 30. For now I cannot change the table schema, but how can I make them to be the same for for Lookup task to match.

    I tried to use substring for the table data, but it is not working

    Thanks

  • You might try RTRIM..

    CEWII

  • Thanks, it works after I rtrim the table column,

    Also see this article may be helpful.

    http://consultingblogs.emc.com/kristianwedberg/archive/2006/02/22/2955.aspx

  • I've been burned by this little problem before.. It makes it easy to remember..

    CEWII

  • Elliott Whitlow (1/26/2012)


    I've been burned by this little problem before.. It makes it easy to remember..

    CEWII

    And don't mention the case sensitivity... :angry:

    Need an answer? No, you need a question
    My blog at https://sqlkover.com.
    MCSE Business Intelligence - Microsoft Data Platform MVP

  • Ah, aparently another burn victim..

    CEWII

  • Do you know if any service pack of SQL 2008 fix these ?

    Thanks

  • None that I am aware of.

    CEWII

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

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