title: Calculate Percentile Rank using NTILE?
body: <p>Need to calculate the percentile rank (1st - 99th percentile) for each student with a score for a single test.</p>
  
  <p>I'm a little confused by the msdn definition of <a href="http://msdn.microsoft.com/en-us/library/ms175126.aspx" rel="nofollow">NTILE</a>, because it does not explicitly mention percentile rank.  I need some sort of assurance that NTILE is the correct keyword to use for calculating percentile rank.</p>
  
  <pre><code>declare @temp table
  (
    StudentId int,
    Score int
  )
  insert into @temp
  select 1, 20
  union
  select 2, 25
  .....
  
  select NTILE(100) OVER (order by Score) PercentileRank
  from @temp
  </code></pre>
  
  <p>It looks correct to me, but is this the correct way to calculate percentile rank?</p>