I have the following XML Source File:
<documents>
<document fileNo='1234'>
<item name='EmployerEmail'><text>BarryBlue@Blue.Inc</text></item>
<item name='EmployerForename'><text>Barry</text></item>
<item name='EmployerSurname'><text>Blue</text></item>
<item name='EmployeeEmail'><text>Gary</text></item>
<item name='EmployeeForename'><text>Green</text></item>
<item name='EmployeeSurname'><text>GarryGreen@Blue.Inc</text></item>
</document>
I want to export this record into an excel file as two separate records for the employer and employee. So my end result would look like this:
I have gotten as far as being able to export the above as a single record with 8 columns. But I'm not sure how to separate them in to two record of 5 columns each.
I am using dataflows in SSIS so if it can be done with dataflows that would be ideal. But if code is the only way I can work with that.
2条答案
按热度按时间w1jd8yoj1#
Just in case, T-SQL and XQuery based solution.
SQL
Output
q3aa05252#
Resolved myself.
I added a multicast to two pivot tables, then used Union All to combine them and outputted to an excel file.