I have the following XML:
<Attributes>
<Map>
<entry key="approvalSet">
<value>
<Approval>
<ApprovalItem application="SP" id="9659102e" name="reporting_queue" operation="Add" />
<ApprovalItem application="SP" id="1013b3f5" name="reporting_queue" operation="Add" />
<ApprovalItem application="SP" id="09648f81" name="reporting_queue" operation="Add" />
</Approval>
</value>
</entry>
<entry key="DisplayName" value=" mike " />
<entry key="Name" value="1222" />
<entry key="policy" />
<entry key="work">
<value>
<WorkLevel>Normal</WorkLevel>
</value>
</entry>
</Map>
</Attributes>
I want to run a select sql that one of the column(attributes) has xml format(attached here). the sql is like:
SELECT
w.created,
W.[attributes],
W.[completer]
FROM [item_archive] W
WHERE W.type='Manual'
How can I get the result of the records value from attributes column which has XML format as a new columns (application
, id
, name
, and operation
) values separably. The XML columns type is nvarchar((max),null)
.