分页存储过程

alter proc usp_Fen

@yema int,

@tiaoshu int,

@count int output

as 

begin

	set @count=(select COUNT(*) from MyStudent) 

	select top (@tiaoshu) * from (select *,ROW_NUMBER() over(order by fid asc ) as rownum from MyStudent ) as t   

	where t.rownum  between @tiaoshu*(@yema-1)+1  and  @tiaoshu*@yema  	

end

你可能感兴趣的:(存储过程)