if(object_id('proc_getStudentPage','P') is not null) drop proc proc_getStudentPage go create proc proc_getStudentPage(@startindex int,@endindex int) as select count(*) from RealPZGL_D select * from ( select row_number() over(order by id) as rowid ,* from RealPZGL_D ) temp where temp.rowid between @startindex and @endindex go