craete proc GetPage( @pageIndex int, @pageSize int, @pageCount int output, @RecordCount int output )asbegin set @RecordCount= select count(*) form emp set @pageCount =celling((@RecordCount*0.1)/@pageSize) select * from ( select *, row_number over(order by id) as rows) as t where rows between (@pageIndex-1)*@pageSize and pageIndex*pageSizeend