declare @page int;
--页码
declare @limit int;
--页大小
select top @limit *
FROM(
select top (@page * @limit)
ROW_NUMBER() OVER (ORDER BY id ) AS RowNum, *
FROM table
Where 1=1
) AS tempTable
where rownum BETWEEN (@page-1)*@limit+1 and @page*@limit
order by RowNum