Merge Join Not equal to

  • Hello everyone,

    I have two comma delimmited data sources which have the same columns:

    MemberID

    TermDate

    ProductCode

    We'll call them SubsetA and SubsetB for our example.

    I can use the MergeJoin transformation task to join these two datasets on MemberID to create a new combined dataset. This works great. However, I need to join only memberID where the TermDAte and ProductCode are not equal. So if this were a SQL statement for example the inner join piece would look something like:

    inner join SubsetA on SubsetB.MemberID = SubsetA.MemberID and

    SubsetB.TermDate <> SubsetA.TermDate and

    SubsetB.ProductCode <> SubsetA.ProductCode

    The merge join (as far as I can tell) only looks like it lets you do "=" inner joins. Can it do "<>" as well? Or is there another SSIS transformation task I should be using to achieve this?

    Thanks,

    Strick

  • You will need to use a merge join and then a conditional split.

    Merge join on the = fields and then pull out the <> fields into another data flow in the conditional split. Your data flow with the <> records does not have to go into another component. If you want to be clean about it you can put it into a data reader destination or go to SQLBI.com and download the trash destination adaptor.

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

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