SSIS:在XML Source中获取子行输出中的父行字段 [英] SSIS: Getting parent row field in sub-row output in XML Source
问题描述
嗨朋友们,
我有一个SSIS包,它使用XML Source Component读取XML文件。
这个XML文件有两个输出。一个用于Invoice,另一个用于InvoiceDetail
XML文件的结构是这样的。
< my:myFields >
< my:group1 >
< my:Invoice >
< < span class =code-leadattribute> my:field1 > 1 < < span class =code-leadattribute> / my:field1 >
< my:field2 > 2014-11-11 < / my:field2 >
< my:field3 > 33370 < / my:field3 >
< my:Group2 >
< my:InvoiceDetail >
< my:Sub6 xsi:nil = true > 100 < / my:Sub6 >
< my:Sub7 xsi:nil = true > 费用< / my:Sub7 >
< my:Sub8 > 140 < / my:Sub8 >
< my:Sub9 xsi:nil = true & gt; 78 < / my:Sub9 >
< my:Sub10 xsi:nil = true > 0 < / my:Sub10 >
< my:Sub12 > 0 < / my:Sub12 >
< / my:InvoiceDetail >
< / my:Group2 >
< my:field18 > < / my:field18 >
< / my:Invoice >
< / my:group1 >
< / my:myFields >
I可以在单独的输出中获取Invoice和InvoiceDetail的所有字段。但是,我无法加入这些行,因为InvoiceDetail没有链接到Invoice的ID(field1)。有什么想法也可以使用InvoiceDetail输出获取InvoiceID字段吗?
(请不要让我在子行中添加ID ..这个文件来自另一个使用InfoPath的零售商。)
谢谢
试试这个Link
Hi Friends,
I have an SSIS Package which reads XML file using XML Source Component.
This XML File has two outputs. One is for "Invoice" and other is for "InvoiceDetail"
The structure of the XML File is like this.
<my:myFields>
<my:group1>
<my:Invoice>
<my:field1>1</my:field1>
<my:field2>2014-11-11</my:field2>
<my:field3>33370</my:field3>
<my:Group2>
<my:InvoiceDetail>
<my:Sub6 xsi:nil="true">100</my:Sub6>
<my:Sub7 xsi:nil="true">Charges</my:Sub7>
<my:Sub8>140</my:Sub8>
<my:Sub9 xsi:nil="true">78</my:Sub9>
<my:Sub10 xsi:nil="true">0</my:Sub10>
<my:Sub12>0</my:Sub12>
</my:InvoiceDetail>
</my:Group2>
<my:field18></my:field18>
</my:Invoice>
</my:group1>
</my:myFields>
I can get all fields of Invoice and InvoiceDetail in seperate outputs. But, I cannot join these rows since InvoiceDetail doesn't have the ID (field1) which links to the Invoice. Is there any idea to get the InvoiceID field also with the InvoiceDetail output ?
(Please don't ask me to add an ID in sub-rows too.. This file comes from another retailer using InfoPath.)
Thanks
try this Link
这篇关于SSIS:在XML Source中获取子行输出中的父行字段的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!