真正的分页存储过程
2013-03-24 14:03
127 查看
IF OBJECT_ID('jjp_CategoryList_Get') IS NOT NULL
DROP PROCEDURE jjp_CategoryList_Get;
GO
CREATE PROCEDURE jjp_CategoryList_Get
(
@pageIndex int,
@PageSize int,
@Records int output
)
AS
begin
with tmpTable as
(
select id, c1, c2 , row_number() over( order by id) as rownum from dbo.t1
)
select * from tmpTable where rownum between (@pageIndex-1)*@PageSize+1 and @PageIndex*@PageSize;
select @Records=count(*) from dbo.t1;
end
DROP PROCEDURE jjp_CategoryList_Get;
GO
CREATE PROCEDURE jjp_CategoryList_Get
(
@pageIndex int,
@PageSize int,
@Records int output
)
AS
begin
with tmpTable as
(
select id, c1, c2 , row_number() over( order by id) as rownum from dbo.t1
)
select * from tmpTable where rownum between (@pageIndex-1)*@PageSize+1 and @PageIndex*@PageSize;
select @Records=count(*) from dbo.t1;
end
相关文章推荐
- [分享]真正的分页存储过程,借鉴了CSDN上众多力量,除BUG版,分享给大家
- 真正的分页存储过程,借鉴了CSDN上众多力量,除BUG版
- 真正的分页存储过程,借鉴了CSDN上众多力量,除BUG版,分享给大家
- 真正高效的SQLServer中数据分页的通用存储过程
- 真正通用的SQL分页存储过程
- 分页存储过程
- 海量分页存储过程+企业类库
- 实现SQL分页的存储过程代码
- 一个高效的数据分页的存储过程 可以轻松应付百万数据
- SQL Server 存储过程的分页方案比拼 (转)
- 存储过程分页
- sql 分页排序的存储过程
- 分页存储过程
- 实现千万级数据的分页通用存储过程
- Delphi调用SQL分页存储过程实例
- 存储过程 分页处理
- SQL Server 存储过程的分页
- SQL Server 存储过程的分页方案比拼
- 邹建的分页存储过程--改了一下
- 老式分页存储过程