来自 新葡亰数据库 2019-11-21 18:24 的文章
当前位置: 澳门新葡亰app > 新葡亰数据库 > 正文

分页存储过程

create proc Usp_getDatabyPage
@PageSize int,
@PageIndex int,
@PageCount int output
as
begin
select *澳门新葡亰官网APP, from
(
select
*,
Rn=row_number() over(order by Tid asc)
from MyTable1
澳门新葡亰app,)as TblMyTable1
where TblMyTable1.Rn between (@PageIndex-1)*@PageSize+1 and @PageIndex*@PageSize

declare @rdCount int
select @rdCount=count(*) from MyTable1
set @PageCount =ceiling(@rdCount/(@PageSize*1.0))
end

本文由澳门新葡亰app发布于新葡亰数据库,转载请注明出处:分页存储过程

关键词: