【发布时间】:2019-07-22 05:48:06
【问题描述】:
在此之前,在 AppHdr 和 Document 中接收到没有命名空间的 XML,我能够从中检索数据。
我在新引入 XML 之前的查询:
SELECT XMLData.Value('(/Root/AppHdr/BizMsgIdr)[1]', 'CHAR(16)') As MessageID,
XMLData.Value('(/Root/Document/CorpActnGnlInf/OffclCorpActnEvtId)[1]', 'CHAR(16)') As EventID
FROM Announcement
新收到的 XML 如下:
<Root>
<AppHdr xmlns="urn:iso:std:iso:20022:tech:xsd:head.001.001.01" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<BizMsgIdr>MY190531X0000007</BizMsgIdr>
</AppHdr>
<Document xmlns="urn:iso:std:iso:20022:tech:xsd:seev.031.001.08" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CorpActnGnlInf>
<OffclCorpActnEvtId>MY190531BONU0007</OffclCorpActnEvtId>
</CorpActnGnlInf>
</Document>
</Root>
请协助介绍如何引入新的 XML 查询。
【问题讨论】:
标签: xml sql-server-2016