复制代码 代码如下:
Createproceduresp_pageQuery

@sqlstrnvarchar(4000),
@page_indexint,
@page_sizeint,
@rec_countintout--
as
setnocounton
declare@cursor_idint
declare@rowcountint

execsp_cursoropen@cursor_idoutput,@sqlstr,@scrollopt=1,@ccopt=1,@rowcount=@rowcountoutput

set@rec_count=@rowcount

set@page_index=(@page_index-1)*@page_size+1

IF@rec_count>0
BEGIN
execsp_cursorfetch@cursor_id,16,@page_index,@page_size
END
ELSE
BEGIN
Select'test'='null'Where1=2
END

execsp_cursorclose@cursor_id
setnocountoff
GO



在要用的时候在那个存储过程里调用
复制代码 代码如下:
CreatePROCEDURE[dev].[P_Mobile_Comment_Page]
@course_ware_idint,
@recCountPerPageint=1,
@pageIndexint=1,
@recordCountint=0out
AS

DECLARE@sqlnvarchar(4000)

SET@sql="
Selectseg_id,course_ware_id,subject,cust_name,content,create_date
FROMT_COURSEWARE_COMMENT
Wherecourse_ware_id="+cast(@course_ware_idasvarchar(10))+"
ORDERBYseg_id"
EXECsp_Pagequery@sql,@pageIndex,@recCountPerPage,@recordCountout

GO


更多相关文章

  1. android分页查询获取系统联系人信息
  2. Android入门教程(三十一)------SQLite分页读取
  3. android ListView的分段显示、分页显示(附源码)
  4. android左右滑动加载分页以及动态加载数据
  5. Android(安卓)listview怎么实现滚动分页
  6. Android(安卓)ListView专题之十二 分页不同的解决方案
  7. Android分页控件xlistview
  8. android中滑动SQLite数据库分页加载
  9. Android(安卓)分页组件

随机推荐

  1. Android(安卓)API 28 使用 android-async
  2. Android Wear Preview- 从通知上接收语音
  3. Android 开源框架的收集
  4. 网络书签about Android
  5. Android UI详解之动态布局
  6. android aidl通讯两个APP之间的应用
  7. android读写文件
  8. C# mono android 图片上传进度条实现
  9. android 2.2+ 完全退出程序的方法
  10. android SpannableString使用详解,替代多