XML Pairs


Please login or register to vote for this query.

(click on this box to dismiss)


Q&A for people looking to bypass life's everyday problems with simple tricks

declare @XML xml
set @XML = 

select @XML.value('(/Tx/T[position() = sql:column("N.number")])[1]', 'int') as Column1,
       @XML.value('(/Tx/C[position() = sql:column("N.number")])[1]', 'int') as Column2
from master..spt_values as N
where N.type = 'P' and
      N.number between 1 and @XML.value('max((count(/Tx/T), count(/Tx/C)))', 'int')

Enter Parameters

Switch to meta site
loading Hold tight while we fetch your results