zoukankan      html  css  js  c++  java
  • [BTS] Use TSQL to query a XML field in SQLServer

    When deploy BizTalk application. I often save XML message to database. 

    When display some field in XML, I need following SQL to query XML field. 

    starttime,
    select  convert(xml,RequestXML).value('(//GENERALDATA/SERIAL_NO)[1]','varchar(30)') SERIAL_NO
    from BizTalkTask
    where interfaceid=10001
    order by id desc


    select 
    starttime,
    convert(xml,RequestXML).query('//GENERALDATA/SERIAL_NO') XmlNode
    from BizTalkTask
    where interfaceid=10001
    order by id desc

      


    An anther sample:

    SELECT x.requestpayload.value('declare namespace s="http://blah.ca/api"; (/s:validate-student-request/s:student-id)[1]', 'int') as studentidFROM xoutput x

     <XmlColumn>.value('...namespace....; (...xPath...)[1]', 'Type') as ColumnAlias

    Key : BizTalk Guideline 入门 教程

    徐中

    北京钛谷诚泽网络通讯科技有限公司

  • 相关阅读:
    Scrapy中间件
    Scrapy简介
    Scrapy解析器xpath
    postman
    yarn
    brew 安装 yarn 时候失败
    immutability-helper 用途+使用方法
    js 正则
    react redux 应用链接
    react 事件传参数
  • 原文地址:https://www.cnblogs.com/xuzhong/p/2799876.html
Copyright © 2011-2022 走看看