XML / XSD以XML字符串的形式获取所有元素和属性

时间:2018-07-09 17:20:26

标签: sql sql-server xml xsd

输入:

sales
    sale
        saleid
        (elements/attributes)

所需的输出:

SaleId, (elements/attributes) as one big string

1 个答案:

答案 0 :(得分:0)

也许您似乎想要:

SELECT n.query(N'.') AS [one big string]
FROM @xml.nodes(N'/Sales/sale') AS t(n);