/* 数据库分页存储过程---equn.net 参数说明: ?tablename为搜索表名 ?where为搜索表名,要显示所有记录请设为"1=1" ?orderby为搜索结果排序,如order by id desc ?curpage当前页码 ?page_record每页记录条数 结果: ?返回表tablename中满足条件where的第curpage页的page_record条记录,结果按orderby排序 */ create procedure xp_page(@tablename varchar(50),@where varchar(100),@orderby varchar(100),@curpage int,@page_record int) ?as begin ?declare @cmd varchar(500) ?declare @uprecord int ?set @[email protected] * @page_record ?set @cmd='select top '+cast(@page_record as char)+' * from '[email protected]+' where '[email protected]+' and id not in (select top '+cast(@uprecord as char)+' id from '[email protected]+' where '[email protected]+' '[email protected] +') '[email protected] ?exec(@cmd) end go,欢迎访问网页设计爱好者web开发。