try this toodeclare @NAD table(Namevl varchar(5),Age integer,Address varchar(5))insert into @NADselect 'a', 10, 'aaa' unionselect 'b', 11, 'bbb' unionselect 'c', 12, 'bbb' select 'age',max([10]),max([11]),max([12])from @NADpivot(max([namevl]) for age in ([10],[11],[12]))p union allselect 'name',convert(varchar(32),max([10])),convert(varchar(32),max([11])),convert(varchar(32),max([12]))from @NADpivot(max([age]) for age in ([10],[11],[12]))sunion allselect 'address',max([10]),max([11]),max([12])from @NADpivot(max(address) for age in ([10],[11],[12]))k
check this link toohttp://sqlblogcasts.com/blogs/madhivanan/archive/2007/08/27/dynamic-crosstab-with-multiple-pivot-columns.aspx