This is part 50 of the series of article on SSIS
Introduction:
In this article we are going to see on how to use Merge transformation in SSIS Packaging. Merge transformation is used in cases where we need to get data from 2 different data source and merge in order specified and send the result to the destination. Merge transformation can be very effective when we need to do manipulation across the data sets or the data source.
[more]Let’s jump start on how to use this task in real time and see the steps to do the configurations. You can look into my series of article on SSIS at the url – https://f5debug.net/tutorial/ssis.php
Steps:
Follow steps 1 to 3 on my first article to open the BIDS project and select the right project to work on integration services project. Once the project is created, we will see on how to use the Merge Transformation task. Once you open the project just drag and drop the Merge transformation control and a source provider as shown in the below image.
Now we need to start configuring the transformation. Let us start with configuring the source data, for that we need to create table as shown in the below screen.
Scripts:
Create table Merger1( Empid int,EmpName Varchar(50))
Create table Merger2( Empid int, EmpName Varchar(50))
Insert into Merger1 values (1,’Arun’)
Insert into Merger1 values (3,’Karthik’)
Insert into Merger1 values (4,’Amit’)
Insert into Merger1 values (6,’Vinoth’)
Insert into Merger2 values (2,’Vijay’)
Insert into Merger2 values (3,’Karthik’)
Insert into Merger2 values (5,’Ruthesh’)
Insert into Merger2 values (7,’Ruthra’)
Select * from Merger1
Select * from Merger2
To configure the sources we need to do the below steps. Here we are going to use a query to fetch the data as shown below
Select Empid,EmpName From Merger1 Order by Empid
Select Empid,EmpName From Merger2 Order by Empid
Your screen looks like below after you configure the first data source.
Similarly do the second data source as shown below
Now once configured the sources we need to configure the Merge transformation task by mapping both the merger source with the merge as shown below
Here we need to do some steps do take the Merge task accept the sources, for this we need to give the sorting to true. Since the task by itself will not make the sorting to merge the data. For that you need to right click on the sources task and select “Show advanced editor” and select the input output properties tab and click on the OLEDB Source output. Then change the IsSorted property to True on the output.
Now we are done with configuration of the sources and the merge task. Now we need to get the output for that we can use a flat file destination as shown in the below screen
Now execute the task (Press F5) you will get the desired output as shown below.
The output we can see in the file which we specified at the configuration of the destination task.
Conclusion:
So in this article we have seen on how to use the Merge transformation task and the key configurations used in order to use this task handy.
No Comments
By devidanderson : A how to tutorial about International cash transfers, global cash transfer, on-line income transfer, Finance with step by step guide from devidanderson. <a href="http://theultrasoundtechnician.com/diagnostic-medical-sonographers/">What Is The Average Salary Of An Ultrasound Technician</a>. I will take that advice. From any place of that corporation anyplace in the globe, the client can send cash to an further location of the very same company someplace else in the globe.
nm
I think we have to use Union all instead of Merger
Just curious if there are any blogging websites where I can start a blog that aren't as well known.. I am already aware of sites like blogger, wordpress, livejournal, xanga, vox, etc. . . Are there any up and coming blogging websites possibly?.
If some one needs expert view on the topic of blogging and site-building afterward i recommend him/her to pay a quick visit this blog, Keep up the fastidious work.|
Thanks for your marvelous posting! I definitely enjoyed reading it, you can be a great author. I will always bookmark your blog and will eventually come back from now on. I want to encourage you to definitely continue your great posts, have a nice morning!|
Hi there very nice site!! Guy .. Beautiful .. Wonderful .. I'll bookmark your website and take the feeds additionally? I'm glad to find so many helpful information here within the submit, we want develop more strategies on this regard, thank you for sharing. . . . . .|
Appreciating the hard work you put into your website and in depth information you provide. It's great to come across a blog every once in a while that isn't the same out of date rehashed material. Wonderful read! I've saved your site and I'm adding your RSS feeds to my Google account.|