declare @x xml = '<doc>
<quote>
<code>AA</code>
</quote>
<quote>
<code>BB</code>
</quote>
<quote>
<code>CC</code>
</quote>
</doc>';
select @x.value('(doc/quote/code)[1]', 'varchar(max)')
, @x.value('(doc/quote/code)[2]', 'varchar(max)')
, @x.value('(doc/quote/code)[3]', 'varchar(max)')
Для @ marc_s,
DECLARE @test TABLE(ID INT, XmlCol XML)
INSERT INTO @test VALUES(1, '<doc>
<quote>
<code>AA</code>
</quote>
<quote>
<code>BB</code>
</quote>
<quote>
<code>CC</code>
</quote>
</doc>')
INSERT INTO @test VALUES(2, '<doc>
<quote>
<code>BB</code>
</quote>
<quote>
<code>AA</code>
</quote>
<quote>
<code>CC</code>
</quote>
</doc>')
SELECT
ID,
XmlCol.value('(doc/quote/code)[1]', 'varchar(20)') AS 'Code1',
XmlCol.value('(doc/quote/code)[2]', 'varchar(20)') AS 'Code2',
XmlCol.value('(doc/quote/code)[3]', 'varchar(20)') AS 'Code3'
FROM @test