Percentile Calculation

with MyData as (
    select distinct
         LineCount 
        ,CountLe    = (select count(1) from #a b where b.LineCount <= a.LineCount)
        ,CountTotal = (select count(1) from #a) 
    from 
        #a a (nolock)
    )
select
     LineCount
    ,Percentile = CountLe * 100.0 / CountTotal
from
    MyData
order by 
    LineCount