July 1, 2008 at 3:35 pm
Hi,
I have 2 tables customer (Name, SSN,custID,Address)and department (DeptID, DeptName, custID, Location)
I would like to merger records row by row i.e result table/file should have
1st row----> Row1 from Table customer
2nd row---->Row1 from table deptartment
3st row----> Row2 from Table customer
4nd row---->Row2 from table deptartment
......................... etc
How can I implement it in SSIS?
Thanks
July 15, 2008 at 12:46 am
July 15, 2008 at 5:29 am
Maybe this gets you the desired result?
In a DataFlow:
1) add a rownumber to both datasets (you might need to add an extra column on the datasources if the order should always be customer first, department second)
2) convert both sets so their columndefinitions are similar (for instance: all datafields converted to a long string)
3) union the datasets
4) sort by rownumber (then on the extra "source"-column when needed)
5) write the desired column(s) to the data destination
I built a similar package when I needed to write a textfile with 4 (distinct) rows per datarecord.
Peter Rijs
BI Consultant, The Netherlands
Viewing 3 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic. Login to reply