Merje Join explanaiton...

Hi guys, even if I googled some article I did not yet understand how Merge Join works. See below:

I have got a table in financial with 10000 rows, I copied and pasted the table in the developing db and I removed just one customer (2728 rows). So we have table Financial 10000 rows, table developing 7272 rows. I sorted the rows (I tried with only one order, two orders..now I got six orders). I merged the table (only one link, two links, three links...etc) but the result is always the same 14828...which is the criteria? I do not understand...Thanks

September 11th, 2015 8:35am

Hi Diegoctn,

It depends on the type of join you use

  • Left outer join: Includes all rows from the left table, but only matching rows from the right table. You can use the Swap Inputs option to switch data source, effectively creating a right outer join.
  • Full outer join: Includes all rows from both tables.
  • Inner join: Includes rows only when the data matches between the two tables.

Free Windows Admin Tool Kit Click here and download it now
September 11th, 2015 1:47pm

Thanks Arthur. And that's why I am wondering why I move 14828 rows. It doesn't make any sense by the waay that the value in the tables are the same..
September 12th, 2015 6:16am

If you want one-to-one, you need to ensure the columns you join on make the row unique. Try doing a similar join in SQL and you should end up with the same number of rows as what the merge join is doing
Free Windows Admin Tool Kit Click here and download it now
September 13th, 2015 6:20pm

Thanks, RyanAB. I know how the join works, that's why I am asking how the merge join works.
September 14th, 2015 4:12am

Thanks Arthur. And that's why I am wondering why I move 14828 rows. It doesn't make any sense by the waay that the value in the tables are the same..

If the values are the same by PK it is doing a UNION (not UNION ALL), add a surrogate key to include in the MERGE JOIN e.g. NEWID(), or add it in the package to the flow http://microsoft-ssis.blogspot.ca/2011/02/create-guid-column-in-ssis.html and then you will able to process all the rows.
Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 9:51am

If you are using Full Outer Join and you remove a record that is in both data flows, you will get this result.  Also if you use Left Outer Join and remove a record that is in the "Right" data flow you will get this result.

Thus the importance of Authur's question to solving this.

September 14th, 2015 12:12pm

Thanks, RyanAB. I know how the join works, that's why I am asking how the merge join works.

?? It works like a join, you should be able to exactly replicate the functionality with a join
Free Windows Admin Tool Kit Click here and download it now
September 14th, 2015 4:17pm

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics