Go Back   CORTEX Forums > Local Happenings > CORTEX Blogs > BI Monkey
Register Blogs FAQ Members List Calendar Search Today's Posts Mark Forums Read

The Merge Transformation

This is a discussion on The Merge Transformation within the BI Monkey forums, part of the CORTEX Blogs category; Fig 1: The Merge Transformation In this post I will be covering the Merge Transformation. The sample package can be found* here for 2005 and guidelines on use are here ...


Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old 20th July 2009, 01:11 PM   #1
Guru
 
Join Date: Jun 2009
Posts: 122
James Beresford is on a distinguished road
Thumbs up The Merge Transformation

Fig 1: The Merge Transformation


In this post I will be covering the Merge Transformation. The sample package can be found*here for 2005 and guidelines on use are here.

What does the Merge Transformation do?

The Merge Transformation merges two sorted data sets and outputs a sorted data set - and by Merge it really means a “Sorted Union All”. You provide it with the two sorted sets, specify the keys on which they are sorted, and the “merge” then takes place, ordering the output on those keys. In my example package, I merge two datasets - each with 290 rows - and get a 580 row dataset as output.

Fig 2: Configuring the Merge Transformation


You can see above you have to specify the sort keys (you can have multiple keys) and then the mappings for the columns.The sort keys must have the property IsSorted set to True - this will be done automatically by the Sort component, but will need to be set manually in the source if the data is sorted outside of SSIS - this is available in the advanced properties of the output columns of a component.

For simplicity in the example I have simply merged the same dataset, though in one copy I have left some columns off to show that you don’t have to match the columns, just the sort keys. All that happens in unmapped columns is that a null is entered for that columns value in the output dataset.

When would you use the Merge Transformation?

Technically, it should be used to merge two sorted datasets to get a sorted merged output data set. In practice, I fail to see much advantage in using this component -The only scenario I can see this being genuinely useful is when you have to Union two very large sorted datasets, need the output to keep that sort, and cannot afford the memory overhead of a blocking Sort component after the Union which will have to recieve all the data before it can do that sort.

The Union All component can accept more than 2 inputs, doesn’t require inputs to be sorted, and if you really need the output sorting, then you can sort the output using a Sort component. I demonstrate this in the sample package in data Flow 2, which returns the same results as the Merge Data Flow but with one less component.

MSDN Documentation for the Merge Transformation can be found here for 2008 and here for 2005.



Get More from the original blog...
James Beresford is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiTweet this Post!
Reply With Quote
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
The Multicast Transformation James Beresford BI Monkey 0 7th July 2009 05:48 AM
The Unpivot Transformation James Beresford BI Monkey 0 4th July 2009 02:20 PM
The Copy Column Transformation James Beresford BI Monkey 0 25th June 2009 10:12 PM
The Conditional Split Transformation James Beresford BI Monkey 0 23rd June 2009 09:34 PM
The Pivot Transformation James Beresford BI Monkey 0 23rd June 2009 09:34 PM


All times are GMT +11. The time now is 09:42 AM.

© The Business Intelligence Group

Search Engine Optimization by vBSEO