declare @tab table( Col1 varchar(10), Col2 varchar(10), Col3 varchar(10), Col4 varchar(10), Col5 varchar(10))
insert into @tab
select 'v1','v2','v1','v1','v2' union all
select 'v1','v2','v3','v2','v1' union all
select 'v2','v2','v3','v2','v1' union all
select 'v3','v1','v2','v1','v1' union all
select 'v3','v1','v3','v1','v1' union all
select 'v3','v1','v3','v1','v1'
declare @cnt int
select @cnt = COUNT(1) from @tab
;with cte as(
select 'Col1' as Col , Col1 as ColValue, CAST(CAST(COUNT(1)*100/(@cnt*1.0) as numeric(4,1)) as varchar) + '%' as cnt from @tab group by Col1 union all
select 'Col2', Col2, CAST(CAST(COUNT(1)*100/(@cnt*1.0) as numeric(4,1)) as varchar) + '%' from @tab group by Col2 union all
select 'Col3', Col3, CAST(CAST(COUNT(1)*100/(@cnt*1.0) as numeric(4,1)) as varchar) + '%' from @tab group by Col3 union all
select 'Col4', Col4, CAST(CAST(COUNT(1)*100/(@cnt*1.0) as numeric(4,1)) as varchar) + '%' from @tab group by Col4 union all
select 'Col5', Col5, CAST(CAST(COUNT(1)*100/(@cnt*1.0) as numeric(4,1)) as varchar) + '%' from @tab group by Col5
)
select Col, isnull([v1],'0%') as v1 , isnull([v2],'0%') as v2, isnull([v3],'0%') as v3
from (
select * from cte
)src
pivot(max(cnt) for ColValue in ([v1], [v2], [v3])) pvt