tags:

views:

10

answers:

3

Im trying to merger data together based upon a primary key that will be the same in two record sets.

I have the first record set with a primary key and 5 coloums of data and then I have a second record set with the primary key and 5 new colums. I want to be able to merge both record sets together so I can see one primary key and 10 coloums with any data that is not applicable just is left null.

Can anyone help please :)

A: 

Even though it's SSIS, I've had more luck writing updates and such using SQL code, and then just using a SQL Task with that code. It's easier than the Merge and Merge Join data flows.

thursdaysgeek
I have to use a merge join as im building up the contents of a revlar. There are several complex calulations that need to be made in SSIS before I can update the data. One way of doing it in SQL would be to use a derived update, but the implications of that are very memory intensive when im making complex calculations
gledhilla
Thanks for the help :)
gledhilla
Check my question http://stackoverflow.com/questions/2853770/guidelines-for-using-merge-task-in-ssis, because one of the answers helped me with the merge task. Not enough, unfortunately.
thursdaysgeek
A: 

http://msdn.microsoft.com/en-us/library/ms141029.aspx

Have you had a look at the how-to guide on MSDN? It's a bit flakey with detail but it should help point you in the right direction.

The most annoying part is the data must be 'sorted' before being merged.

http://www.mssqltips.com/tip.asp?tip=1322

MSSQL tips has a much more comprehensive guide on how to get the Merge Join working. Just substitute their data-source for whatever you may be using.

Good luck, hope you get it working.

Wes Price
thanks for the help. I Managed to get it working!
gledhilla
A: 

Hi

Use the Merge Join component in SSIS use the left outer join in the join condition.

your primary key columns as join key.

Merge join needs sorting before merging so make sort property of both the components as true and select the sort key order.

thanks

prav

praveen