Q&A for spacecraft operators, scientists, engineers, and enthusiasts
declare @t table (i int , name nvarchar(max)) insert into @t select 1,'a' union all select 2,'a24234' union all select 3,'a' union all select 4,'23a' union all select 5,'a5235' union all select 6,'14a' union all select 7,'a4234' union all select 8,'a3434' union all select * from @t declare @pageItems int=3 declare @pagenum int=1 select * from ( SELECT [i],name, row_number() over ( order by i) as n FROM @t) a where a.n > (@pagenum-1)*@pageItems and a.n<= (@pagenum)*@pageItems