У меня есть столбец ( атрибуты ) в SQL, который содержит XML данные. Не могли бы вы посоветовать, как извлечь Ошибки подробности из этих XML данных
![enter image description here](https://i.stack.imgur.com/t0Rcn.jpg)
Я пытался выполнить приведенный ниже запрос: не работает.
SELECT top 10 identity_name,
CAST (tr.attributes as xml).value('(Attributes/Map/entry/value/accountrequest/ProvisioningResult/Errors[@key="Message"])[1]/@value','nvarchar(200)') as Message
From [identityiq].[identityiq].[spt_provisioning_transaction] as tr
where id = '8aae1d866d49a4b2016d57852fc3503b'
XML данные ниже
<Attributes> <Map> <entry key="accessRequestId" value="0000086661"/> <entry key="request"> <value> <AccountRequest application="Active Directory" nativeIdentity="123" op="Modify"> <Attributes> <Map> <entry key="provisioningTransactionId" value="8aae1d866cace49c016cf7e26a7f4a8a"/> </Map> </Attributes> <AttributeRequest name="memberOf" op="Remove" value="Testgroup"/> <ProvisioningResult> <Errors> <Message key="Errors returned from IQService. "Failed to update attributes for identity 123. Failed to connect to the server for Testgroup"" type="Error"/> </Errors> </ProvisioningResult> </AccountRequest> </value> </entry> </Map> </Attributes>