try this shaggy,declare @test table( id int, name varchar(32))insert into @test select 1,'test'insert into @test select 2,'test1'insert into @test select 3,'test4'select val1,[1],[2],[3]from (select row_number()over(partition by val1 order by val1) as rid,val1,cast(val2 as varchar(100)) AS val2from @testunpivot (val2 for val1 in (id)) punion all select row_number()over(partition by val1 order by val1) as rid,val1,val2from @testunpivot (val2 for val1 in (name)) p)spivot(max(val2) for rid in ([1],[2],[3]))p