You can use a string splitter such as DelimitedSplit8K - see the example below:declare @col varchar(512) = 'CN-FCT?AB3457;~XXXXXX;~CN-FCT?AB3458;~YYYYYY;~CN-FCT?AB3459;~ZZZZZZ';
select ';'+item from dbo.DelimitedSplit8K(REPLACE(@col,';~',';'),';')
where ItemNumber%2 = 0 for xml path('')The DelimitedSplit8K is available here: http://www.sqlservercentral.com/articles/Tally+Table/72993/