If you want to concatenate all values of the backend/@name
attributes (ala GROUP_CONCAT
):
select testrig.fxConfigurations(null)
.query('data(configurations/context[@name="apera"]/backends/backend/@name)')
If you need to work with the attributes individually, you may need to use nodes
to extract them:
WITH cteXml AS
(
SELECT testrig.fxConfigurations(null)
.query('configurations/context[@name="apera"]') as context
)
SELECT Nodes.node.value('@name', 'varchar(50)') AS backEndName
FROM cteXml
CROSS APPLY cteXml.context.nodes('//backends/backend') as Nodes(node);