我有一个以XML格式存储数据的表.我需要从两个 node 获取数据.
示例脚本:
select MARKUP_MESSAGE
from TABLE_NAME
where row_uno = 6599064
示例结果:
<PrebillMarkup xmlns="clr-namespace:Aderant.Query.ViewModels;assembly=Aderant.Query"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<PrebillMarkup.NewValues>
<x:String x:Key="Narrative" xml:space="preserve">Review of policies against previous policies</x:String>
</PrebillMarkup.NewValues>
<PrebillMarkup.OriginalValues>
<x:String x:Key="Narrative" xml:space="preserve">Review of policies against previous policies sdffddgsgfdfdg</x:String>
</PrebillMarkup.OriginalValues>
</PrebillMarkup>
我有两个 node <PrebillMarkup.NewValues>
和<PrebillMarkup.OriginalValues>
.
我希望能够从<PrebillMarkup.NewValues>
中拿出x:String
来阅读"额外政策的审查-测试"
因此,当我运行该语句时:
select MARKUP_MESSAGE
from TABLE_NAME
where row_uno = 6599064
结果将是"额外政策的审查-测试"
或者,如果我执行另一个查询来提取文本值
<x:String x:Key="Narrative" xml:space="preserve">
任何关于如何做到这一点的 idea ,因为我每次try 都会获得更多的XML数据,但我只需要纯文本.
谢谢所有人
SQL版本:
Microsoft SQL Server 2019 - 15.0.4280.7 (X64)
Standard Edition (64-bit) on Windows Server 2019 Standard 10.0 <X64>