【发布时间】:2019-08-12 23:10:36
【问题描述】:
我的 XMLData 存储在 table.[column] 下:dbo.promotions.[PromotionDiscountData] 当我展开它时,XML 如下所示:
<ArrayOfPromotionDiscountBase xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
<PromotionDiscountBase xsi:type="OrderPromotionDiscount">
<DiscountType>Fixed</DiscountType>
<DiscountAmount>5.0000</DiscountAmount>
</PromotionDiscountBase>
</ArrayOfPromotionDiscountBase>
我想导出报告并将 xml 展平为一列,其中包含 dbo.promotions 表中的所有其他内容。 从 xml 中获取 DiscountType 和 DiscountAmount 的最佳方法是什么?
谢谢!
【问题讨论】:
-
使用 XQUERY。到目前为止,您尝试了哪些方法,为什么没有成功?
标签: sql sql-server xml