我在名为“AlgorithmLog”的表的 [XMLValue] 列中有类似以下代码:
<?xml version="1.0" encoding="utf-8"?>
<AdapterInfo xmlns:i="http://www.w3.org/2001/XMLSchema-instance"
xmlns:d1p1="http://schemas.datacontract.org/2004/07/Adapters.Adapter.CloudTrader"
xmlns="http://schemas.datacontract.org/2004/07/Adapters.Adapter"
i:type="d1p1:AlgorithmStatusReport">
<SequenceNumber>0</SequenceNumber>
<TrackingGuid i:nil="true" />
<d1p1:Broker>Default</d1p1:Broker>
...
<d1p1:XMLValue><?xml version="1.0"?><int xmlns="http://schemas.microsoft.com/2003/10/Serialization/">1900</int></d1p1:XMLValue>
</AdapterInfo>
我想在节点内获取值“1900”<d1p1:XMLValue>
所以这是我的查询:
WITH XMLNAMESPACES('http://schemas.datacontract.org/2004/07/Adapters.Adapter' AS x,
'http://schemas.datacontract.org/2004/07/Adapters.Adapter.CloudTrader' As p,
'http://schemas.microsoft.com/2003/10/Serialization/'as w)
SELECT
XMLValue.query('(/x:AdapterInfo/p:XMLValue/w:int)[1]')AS [XMLVaule]
FROM AlgorithmLog
但它什么也不返回。
谁能告诉我我在哪里做错了或者我该怎么做?
谢谢你。