13 lines
		
	
	
		
			421 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
			
		
		
	
	
			13 lines
		
	
	
		
			421 B
		
	
	
	
		
			SQL
		
	
	
	
	
	
SELECT * FROM (
 | 
						|
Select FormatID, Name
 | 
						|
, v.value('./@TransType', 'int') MyIndex
 | 
						|
, v.value('./@TransFormat', 'varchar(255)') TabFormat
 | 
						|
FROM Formats
 | 
						|
CROSS APPLY Data.nodes('//TransTypes') TempXML(v)
 | 
						|
--where v.value('./@TransFormat', 'varchar(255)') not like '%{Last Step}%'
 | 
						|
) AS SRC
 | 
						|
PIVOT( Max(TabFormat) FOR MyIndex IN (
 | 
						|
[0], [1],[2],[3],[4],[5],[6],[7],[8], [9], [10], [11], [12], [13], [14]
 | 
						|
)) AS PVT1 Order by FormatID
 | 
						|
 |