Ich versuche Wert eines Attributs von XML in SQL-Tabelle zu erhaltenDrucken XML-Attribut in SQL Server
<?xml version="1.0" encoding="utf-8"?>
<container>
<Property Name="paramA" Vocabulary="someVocu">
<Property Name="paramB" Value="valueA" />
<Property Name="paramC" Value="valueB" />
</Property>
<Property Name="paramA" Vocabulary="anotherVocu">
<Property Name="paramB" Value="valueY" />
<Property Name="paramC" Value="valueZ" />
</Property>
</container>
select x.XmlCol.value('(Property[@Name="paramB"]/@Value)[1]', 'varchar(50)') from tempTbl CROSS APPLY rawxml.nodes('/container') AS x(XmlCol)
Ich versuche, „WertA“ und „valueY“ Ich erhalte eine NULL zu drucken.
Wie kann ich das tun? Auch
Dank