SSIS 2012 Lookup not considering duplicate records from reference dataset

  • I am using SSIS 2012, SQL Server 2012 both for source and destination.This is in regards loading a fact table.

    I am using a Lookup and that Lookup table has values like.

    Store table

    storekey StoreNum PSLocationKey

    923 14120 500

    1753 14120 500

    From the source I am Pulling StoreNum and Looking up using the StoreNum "ONLY" and returning StoreKey and LocationKey from the Lookup and loading it into the fact table. In the above case I want to load both the records from the lookup table as I am joining on StoreNum.But only the 1st record gets loaded.As if the second record does not gets considered at all. if I interchange the order of the records in the Lookup table only the 1st record from Lookup table gets considered.I did try using SQL in the Looup transformation and hard code using UNION ALL.Did try various cache options. Also tried Lookup Property Considering Duplicate records as error TRUE/FALSE.No effect.

    I read a post .But this dates back to year2008.

    The other alternative I tried using multicast transformation and 2 looksup transformation.Each Lookup has 1 of the records and it works.I can see both the records in the pipeline.But what if there are 3 records or 4 records of such type.I cannot dynamically add Lookup transformation.

    The only option for me is to use SQL Command and variables in source. But this defeats the purpose of SSIS.

    Please sugesst me how can I implement this only with 1 Lookup transformation.

  • Nilesh-788004 (5/10/2014)


    I am using SSIS 2012, SQL Server 2012 both for source and destination.This is in regards loading a fact table.

    I am using a Lookup and that Lookup table has values like.

    Store table

    storekey StoreNum PSLocationKey

    923 14120 500

    1753 14120 500

    From the source I am Pulling StoreNum and Looking up using the StoreNum "ONLY" and returning StoreKey and LocationKey from the Lookup and loading it into the fact table. In the above case I want to load both the records from the lookup table as I am joining on StoreNum.But only the 1st record gets loaded.As if the second record does not gets considered at all. if I interchange the order of the records in the Lookup table only the 1st record from Lookup table gets considered.I did try using SQL in the Looup transformation and hard code using UNION ALL.Did try various cache options. Also tried Lookup Property Considering Duplicate records as error TRUE/FALSE.No effect.

    I read a post .But this dates back to year2008.

    The other alternative I tried using multicast transformation and 2 looksup transformation.Each Lookup has 1 of the records and it works.I can see both the records in the pipeline.But what if there are 3 records or 4 records of such type.I cannot dynamically add Lookup transformation.

    The only option for me is to use SQL Command and variables in source. But this defeats the purpose of SSIS.

    Please sugesst me how can I implement this only with 1 Lookup transformation.

    My first thought is that you will have to feed distinct StoreNum PSLocationKey into the Lookup, it doesn't like Cartesian Product in the output.

    😎

  • The store records have different effectivefrom and EffecttiveTodate. I ahve to load data that matches both the records in my facts.So if the user selects date that is within the 1st store range.It will show data for 1st record else the second store record. I cannot achieve this through lookup is it because it is syncronous.It Does not produce multiple records.

  • You can get around this by making your source a query that joins to that reference table.

  • That's what I am forced to do.I wish Lookup could handle that.We cannot use variable in Lookup transformation.

    Will also try with LOOKUP PLUS from Codeplex.

Viewing 5 posts - 1 through 4 (of 4 total)

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