【问题标题】:Retrieved data from XML using SQL-SERVER-2016 containing namespace使用包含命名空间的 SQL-SERVER-2016 从 XML 中检索数据
【发布时间】: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


    【解决方案1】:
    猜你喜欢
    • 2015-11-19
    • 2012-01-03
    • 1970-01-01
    • 1970-01-01
    • 2011-01-02
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2023-03-17
    相关资源
    最近更新 更多