使用sql从父节点提取XML数据

时间:2017-06-13 10:26:57

标签: sql xml xmldatasource

我有一个xml数据如下

<ArrayOfGMADWrapperDto >
<GMADWrapperDto>   
    <GMADHeaderDto>  
        <GMADHeaderId>0</GMADHeaderId>  
        <FileHeaderRecordType>23</FileHeaderRecordType>  
        <Version>1</Version>  
        <StartTimeStamp>2017</StartTimeStamp>  
        <OriginalFileName>GMAD</OriginalFileName>
    </GMADHeaderDto>
    <GMADDetailDtoList>
        <GMADDetailDto>
            <GMADDetailId>0</GMADDetailId>
            <GMADHeaderId>0</GMADHeaderId>
            <RecordType>23120</RecordType>
        </GMADDetailDto>
        <GMADDetailDto>
            <GMADDetailId>0</GMADDetailId>
            <GMADHeaderId>0</GMADHeaderId>
            <RecordType>23120</RecordType>
        </GMADDetailDto>
    </GMADDetailDtoList>
</GMADWrapperDto>
<GMADWrapperDto>
    <GMADHeaderDto>
        <GMADHeaderId>0</GMADHeaderId>
        <FileHeaderRecordType>23</FileHeaderRecordType>
        <Version>1</Version>
        <StartTimeStamp>20172</StartTimeStamp>
        <OriginalFileName>GMAD</OriginalFileName>
    </GMADHeaderDto>
    <GMADDetailDtoList>
        <GMADDetailDto>
            <GMADDetailId>0</GMADDetailId>
            <GMADHeaderId>0</GMADHeaderId>
            <RecordType>23120</RecordType>
        </GMADDetailDto>
        <GMADDetailDto>
            <GMADDetailId>0</GMADDetailId>
            <GMADHeaderId>0</GMADHeaderId>
            <RecordType>23120</RecordType>
        </GMADDetailDto>
    </GMADDetailDtoList>
</GMADWrapperDto>

我希望将包含在<GMADWrapperDto>节点下的数据作为行提供给表变量。在这里,我们在<GMADWrapperDto>下有两组数据。这意味着,我们需要在表中获得两行记录。请帮助我

0 个答案:

没有答案