Neo
Neo

Reputation: 16229

Not able to insert merge values in one row using ssis?

I have two excel source on one excel file 1st fetching value date and 2nd fetching value price now i have tried merge then union all also to get those two values in one derived column but when i execute my package it is inserting values separately. like this into two rows one by one but i want to insert these two values in one row only.

for example this is my problem:

date price
12-12-2001 null

date price
null 54

but i want it in one row only like

date price
12-12-2001 54

enter image description here

Upvotes: 1

Views: 5989

Answers (1)

Daryl Wenman-Bateson
Daryl Wenman-Bateson

Reputation: 3954

Create two derived columns with the same value (i.e. call them id1 and id2 and set both to have a value of 1).

Change the sort to sort by the new id columns.

Change the merge component to a merge join and use the newly created ids to link the data based on an inner join

SSIS Merge Join

which will give you a single row

Data flow for single row

Upvotes: 2

Related Questions