我无法构建正确的语法来在我的 sql sever 2008 上执行与 XML 字段相关的任何查询。
我有一个简单的表,其中包含 Idproduct、ProductName 和 XmlProduct 等字段。..和 XmlProduct 字段如下所示:
<DynamicProfile xmlns:i="http://www.w3.org/2001/XMLSchema-instance" xmlns="http://schemas.datacontract.org/2004/07/WinTest">
<AllData xmlns:d2p1="http://schemas.microsoft.com/2003/10/Serialization/Arrays">
<d2p1:KeyValueOfstringstring>
<d2p1:Key>MyFirstKey</d2p1:Key>
<d2p1:Value>MyFirstValue</d2p1:Value>
</d2p1:KeyValueOfstringstring>
<d2p1:KeyValueOfstringstring>
<d2p1:Key>MySecondKey</d2p1:Key>
<d2p1:Value>MySecondValue</d2p1:Value>
</d2p1:KeyValueOfstringstring>
</AllData>
</DynamicProfile>
例如,我需要编写一个查询,将包含节点值的所有行提取到“MySecondKey”。怎样才能做到这一点?