DECLARE @x xml
SET @x='<data>
<add key="images" value="image/path/img.gif">a</add>
<add key="images2" value="image/path/img2.gif" >b</add>
<add key="images3" value="image/path/img3.gif" >c</add>
</data>';
SELECT s.value('.', 'VARCHAR(8000)') AS myVal from @x.nodes('/data/add') AS t(s)
我想看看(3个添加元素)
add
add
add
但我看到的只是
a
b
c
我错过了什么?