我有一个在 SQL Server 12.0 实例上运行的复杂 SQL 列结构,如下所示:
<setting typeid="2EE4A744-0A64-4A04-9970-BF7F25B29700">
<name>MirrorImage</name>
<value>No</value>
</setting>
<setting typeid="5C60858E-6C3D-4859-9BFD-0FEE56703B41">
<name>Rotation</name>
<value>0</value>
</setting>
<setting typeid="30E4BDC9-DB33-4E33-A269-17B6F5991FB3">
<name>BlackAndWhiteMode</name>
<value>Yes</value>
</setting>
<setting typeid="9504767D-20F5-4AEC-8DBE-0D6824B795CF">
<name>EdgeStorageStreamIndex</name>
<value>0</value>
</setting>
<setting typeid="CAC23FD5-8947-46AC-BC1C-76A923AC6797">
<name>EdgeStorageEnabled</name>
<value>False</value>
</setting>
<setting typeid="F64474E9-F412-4865-A588-092699E2A0DA">
<name>MulticastVideoPort</name>
<value>1234</value>
</setting>
<setting typeid="1905B0B5-7215-4324-AD5F-558E973409C9">
<name>MulticastAddress</name>
<value>215.0.153.236</value>
</setting>
<setting typeid="580E52DD-D468-4B04-B3C9-FB10C62CD38F">
<name>MulticastTTL</name>
<value>10</value>
</setting>
<setting typeid="953EC33E-C49E-42AC-A10F-98A247E28FEB">
<name>EdgeStorageRecording</name>
<value>Continuous</value>
</setting>
<setting typeid="338D6DB1-160E-4CAC-A5D4-3FCF8068A955">
<name>PTZEnabled</name>
<value>false</value>
</setting>
<setting typeid="2C975BBA-0DC8-4A92-B2E4-2B31EA7D58B0">
<name>PTZDeviceID</name>
<value>1</value>
</setting>
<setting typeid="ADFF2878-B96C-47FF-AEEC-DF2BE5679B7B">
<name>PTZCOMPort</name>
<value>1</value>
</setting>
<setting typeid="2A18E5A2-A31B-4D69-9445-CBF12501ABCD">
<name>PTZProtocol</name>
<value>1</value>
</setting>
<setting typeid="7244099B-01E8-4EAF-A4EE-AD0BBD9E8C9A">
<name>PTZCenterOnPositionInView</name>
<value>true</value>
</setting>
我想获取特定 typeid 的值。例如,我想获取 typeid 为 9504767D-20F5-4AEC-8DBE-0D6824B795CF 的所有值。
现在,我的请求看起来像这样,但我无法过滤 typeid :
SELECT Name, Settings.query('/properties/settings/setting') AS settings
FROM [dbo].[Devices]
WHERE DeviceType LIKE '%Camera%' AND Name LIKE '%caméra 1'
ORDER BY Name
问候,
斯蒂芬