乙個分頁的儲存過程

2021-04-02 15:11:33 字數 873 閱讀 8361

create procedure getforumlist @editionid int, @pageindex int as

set nocount on

declare @beginid int, @endid int  /* 定義開始與結束id*/

declare @lowerbound int,@upperbound int  /*定義上下限*/

set @lowerbound= (@pageindex-1)*20+1

set @upperbound=@pageindex*20

set rowcount @lowerbound

select @endid=id from infobbs where parentid=0 and show='y' and edition=@editionid and topmost='n' order by id desc /*獲取endid*/

set rowcount @upperbound

select @beginid =id from infobbs where parentid=0 and show='y' and edition=@editionid and topmost='n' order by id desc /*獲取beginid*/

set rowcount 0  /*清除rowcount*/

set nocount off

select id,title,sendname,sendtime from infobbs where parentid=0 and show='y' and edition=@editionid and topmost='n'  and id between @beginid and @endid order by id desc

go

乙個分頁儲存過程

page language c import namespace system.data import namespace system.data.sqlclient 訂單號 服務專案 預訂日期 操作人員 分配狀態 databinder.eval container.dataitem,offerid...

乙個分頁儲存過程

louje 分頁儲存過程 create procedure usp page pagesize int,頁大小 pageno int,頁號 tablename nvarchar 500 表名 keyword nvarchar 20 主鍵 fieldname nvarchar 2000 要顯示的欄位名...

乙個分頁儲存過程

create procedure sp page tb varchar 50 表名 col varchar 50 按該列來進行分頁 coltype int,col 列的型別,0 數字型別,1 字元型別,2 日期時間型別 orderby bit,排序,0 順序,1 倒序 collist varchar...