SELECT PC_COMP_CODE, \'R\', PC_RESUB_REF, DECODE(PC_SL_LDGR_CODE, \'02\', \'DR\', \'CR\'), PC_DEPT_NO DEPT, \'\', --PC_DEPT_NO,
join this "literal table",
select t.c.value('@c', 'varchar(30)') code, t.c.value('@v', 'varchar(30)') val from (select convert(xml, '') aXmlCol) z cross apply aXmlCol.nodes('/x') t(c)