我的日记本程序日记列表存储过程分页
2014-09-10 15:00
183 查看
最近在写一个个人的日记本程序,今天做了日记的存储过程分页。研究了半天,参考了多方资料终于写出来了。发表出来纪念一下。
实现的特殊一点的功能是可以传入where条件,这样的话如果需要什么样的过滤条件可以直接在DAL层进行设置,实现灵活性。
实现的特殊一点的功能是可以传入where条件,这样的话如果需要什么样的过滤条件可以直接在DAL层进行设置,实现灵活性。
create proc procDiary --获取日记列表的分页存储过程 @pageSize int =12, -- @pageIndex int=1, --页码序号 @totalCount int output, --总记录数 @diaryWhere varchar(255) as declare @strSql varchar(500); set @strSql = 'set nocount on select top ('+convert(varchar(50),@pageSize)+') fid,fcid,ft opic al,faddDate,feditDate into #diary from t_Diary where Fid not in(select top (('+convert(varchar(50),@pageIndex)+'-1)*'+convert(varchar(50), @ pageSize)+') fid from t_Diary)' + convert(varchar(255),@diaryWhere) + 'order by FaddDate desc,Fid desc select * from #diary drop table #diary set nocount off'; exec(@strSql);
相关文章推荐
- ASP.NET结合存储过程写的通用搜索分页程序
- asp与存储过程的分页程序
- 分页存储过程 + In 表达式列表使用
- oracle顺序控制语句goto、null和分页过程中输入输出存储、java程序的调用过程
- ASP.NET结合存储过程写的通用搜索分页程序
- ASP.NET结合存储过程写的通用搜索分页程序
- 分页存储过程(增加了选择字段列表、排序方式参数)
- ASP.NET结合存储过程写的通用搜索分页程序
- 我的日记本程序日记列表存储过程分页(2)改进正式可用
- 利用分页存储过程开发分页程序
- ASP.NET结合存储过程写的通用搜索分页程序
- ASP.NET结合存储过程写的通用搜索分页程序
- winform 调用存储过程显示分页列表
- T-SQL存储过程:产品分页列表提取
- ASP.NET结合存储过程写的通用搜索分页程序
- 存储过程分页程序
- DB2中通用的存储过程分页程序
- 黑马程序员_学习日记72_724ASP.NET(ViewState、Cookie、Session、登录、分页存储过程)
- Sql Server2005学习笔记(存储过程:分页小程序)
- ASP.NET结合存储过程写的通用搜索分页程序