Following is the data and Select statement to work with :
declare @XMLdata xml
set @XMLdata = '
<taggroup key="pros" name="Le pour">
<tag isuseradded="false" count="1">Bonne qualité</tag>
<tag isuseradded="false" count="1">Correspond à mes attentes</tag>
<tag isuseradded="true" count="1">Impeccable</tag>
<tag isuseradded="false" count="1">Prix abordable</tag>
</taggroup>
'
select
ParamValues.ID.value('(./@key)','nvarchar(max)') as TagGroupKey,
ParamValues.ID.value('(./@name)','nvarchar(max)') as TagGroupName,
ParamValues.ID.value('(./tag)[1]','nvarchar(max)') as TagValue,
from @XMLData.nodes('taggroup') as ParamValues(ID)
I need to extract the 4 tag values
(Bonne qualité
,Correspond à mes attentes
,Impeccable
,Prix abordable
)
without actually going to the tag level since that is impacting the performance.