Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

merge join

Posted on 2010-11-17
10
Medium Priority
?
600 Views
Last Modified: 2013-11-10
merge join in distinctively SSIS, not TSQL, right? how does it differ than the other kinds of join (inner, left, self etc)

thanks
0
Comment
Question by:anushahanna
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
  • +2
10 Comments
 
LVL 60

Accepted Solution

by:
chapmandew earned 668 total points
ID: 34161464
Its in both....but they are essentially the same idea.

Inner/Outer/Full joins are LOGICAL joins in the database engine.  Nested Loop/Merge/Hash joins are the physical representations of the logical joins.  Nested loop joins are two outputs, usually a large input and a small input and the small input loops into the large input.  Merge has to sort the two inputs and then merge them together to join them.  Works really well if the inputs are already sorted.  Hash is for the looping scenario OR for two large inputs that are not indexed.  

No, the merge in SSIS is similar to the merge join in the db engine in that it has to physically sort (preceeded by a sort task) before you can merge the results.

Clear as mud?  :)
0
 
LVL 60

Expert Comment

by:chapmandew
ID: 34161469
Correction:
No, the merge in SSIS is similar to the merge join in the db engine in that it has to physically sort (preceeded by a sort task) before you can merge the results.

...missed the w on Now.
0
 
LVL 30

Expert Comment

by:Reza Rad
ID: 34161893
as Champandew noted this is exactly like join types in t-sql.
there are these types there:
inner join --> like inner join in t-sql
full outer join--> like full outer join in t-sql
left outer join --> like let outer join in t-sql
there in no right outer join in merge join transform, but you can only change inputs and use left outer join to have right outer join .

0
What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

 
LVL 30

Assisted Solution

by:Reza Rad
Reza Rad earned 664 total points
ID: 34161907
And note that when you want to use Merge Join Transform in SSIS , your inputs should be SORTED.
0
 
LVL 23

Assisted Solution

by:Racim BOUDJAKDJI
Racim BOUDJAKDJI earned 332 total points
ID: 34162309
As indicated, MERGE JOIN is the physical method that SQL Server's optimizer may select to implement some of its JOIN implementations.   SQL MERGER JOIN is the procedural implementation of the SQL JOINS, which are themselves the implementations of the relational JOIN.

In SSIS, though there are order prerequisites that do not exists in the TSQL engine.

Hope this helps...
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34162782
thanks-

merge join in SSIS- is it possible to say 'No thanks for physical sorting - just inner join the 2 OLEDB input and give it in any sort order"
0
 
LVL 6

Assisted Solution

by:subhashpunia
subhashpunia earned 336 total points
ID: 34162825
Then use other type of joins: Either Nested Loop or HASH join.
0
 
LVL 30

Assisted Solution

by:Reza Rad
Reza Rad earned 664 total points
ID: 34163727
NO,
if you want to use Merge Join Transformation , so you SHOULD sort inputs.
if you don't want to sort inputs, you can use Lookup transformation ( if your inputs are oledb, and you have only ONE joining field) or use t-sql joins in OLEDB Source command if your inputs are both from single server.
0
 
LVL 60

Assisted Solution

by:chapmandew
chapmandew earned 668 total points
ID: 34163742
>>merge join in SSIS- is it possible to say 'No thanks for physical sorting - just inner join the 2 OLEDB input and give it in any sort order"

Nope, you can't do a "merge join" without sorted inputs.
0
 
LVL 6

Author Comment

by:anushahanna
ID: 34165137
Thanks for the help on understanding the merge..
0

Featured Post

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Why is this different from all of the other step by step guides?  Because I make a living as a DBA and not as a writer and I lived through this experience. Defining the name: When I talk to people they say different names on this subject stuff l…
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
Via a live example, show how to extract insert data into a SQL Server database table using the Import/Export option and Bulk Insert.

721 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question