The following procedure might help:--Creating TableCreate Table Ex(LossAmount int, Seq int Identity(1,1) )--Inserting Sample DataInsert Into ExSelect 6087Union ALLSelect 2605Union ALLSelect 2308Union ALLSelect 2278Union ALLSelect 1770Union ALLSelect 1060Union ALLSelect 714Union ALLSelect -3039Union ALLSelect -3954Union ALLSelect -6955Union ALLSelect -7522Union ALLSelect -8637Union ALLSelect -9065Union ALLSelect -11582Union ALLSelect -13349Union ALLSelect -14379Union ALLSelect -17526Union ALLSelect -17730Union ALLSelect -21084--Procedure For your RequirementCreate Procedure dbo.PercentileCalculator@Percentile floatAsBeginDeclare @count int = (Select COUNT(*) From Ex)Declare @PerValue FloatSet @PerValue = Round( ((@Percentile/100) * @count), 0);With CTEAs(Select LossAmount, ROW_NUMBER() Over (Order By LossAmount) As rn From Ex)Select * From CTEWhere rn = @PerValueEnd--Executing procedureExecute dbo.PercentileCalculator 99.60
N 28° 33' 11.93148"E 77° 14' 33.66384"