I have a table in SQL Server 2012 which has an XML field. The field contains arrays (the number of elements is not constant) in the following format:
<values>
<value>A</value>
<value>B</value>
<value>C</value>
<value>D</value>
</values>
and I would like to turn it into a varchar like this:
'A;B;C;D'
I have tried:
SELECT myField.value('.', 'NVARCHAR(50)')
FROM myTable
which creates 'ABCD' but I don't know how to delimit it (In the real case they are not single character values).