2011年01月11日
luyued 发布于 2011-03-08 12:45 浏览 N 次时尚在线分页分类存储过程
Use fs99
Go
ALTER PROC storyshow
@b_brandsort int, --声明数据分类
@tPageCount int OUTPUT, --输出参数,总页数
@tPageSize int, --每页显示多少条记录
@tPageNo int --当前页码
AS
SET NOCOUNT ON
BEGIN
/*取得总记录条数*/
DECLARE @tRecordCount int --总记录条数
SELECT @tRecordCount=COUNT(b_id) FROM tab_brandshow
/*确定总的页数*/
IF (@tRecordCount % @tPageSize) = 0
SET @tPageCount=CEILING(@tRecordCount/@tPageSize)
ELSE
SET @tPageCount=CEILING(@tRecordCount/@tPageSize)+1
/*如果输入的页码大于总的页数*/
IF @tPageNo > @tPageCount
SET @tPageNo = @tPageCount
/*确定当前页记录的起止标记*/
DECLARE @tStart int , @tEnd int --设置起止标志
SET @tStart=(@tPageNo-1) * @tPageSize
SET @tEnd =@tStart+@tPageSize+1
/*由其止标记得到当前页的记录*/
DECLARE @nsql VARCHAR(400)
set @nsql='select top '+STR(@tPageSize)+' * from tab_brandshow WHERE b_id NOT IN( SELECT TOP '+STR(@tStart)+' b_id FROM tab_brandshow where b_ispass='+STR(@b_brandsort)+' ORDER BY b_id desc) and b_ispass='+STR(@b_brandsort)+' ORDER BY b_id desc'
EXEC(@nsql)
/*我们把总记录做为返回值,这样存储过程就变了有返回值,输出参数和记录集了*/
RETURN @tRecordCount --做为返回值
END
pages模块:
=-------------------------
<%@LANGUAGE="VBSCRIPT" CODEPAGE="936"%>
http://www.chinasszx.com">首页 | http://business.chinasszx.com" style="color:red">商业动态 | http://www.chinasszx.com/member/user_logok_default.asp">商务中心 | http://www.chinasszx.com/blank/">百货商城 | http://www.chinasszx.com/fashion/">服饰潮流 | http://www.chinasszx.com/qiyefair.html">企业频道
中国时尚在线
http://www.chinasszx.com/"> alt="中国时尚在线" src="http://www.chinasszx.com/2010images/logo.png" width="218" height="77" />
- http://business.chinasszx.com/brands/index.html">品牌
- http://business.chinasszx.com/brands/list/list_63.html">家居
- http://business.chinasszx.com/brands/list/list_65.html">皮具
- http://business.chinasszx.com/brands/list/list_57.html">男装
- http://business.chinasszx.com/brands/list/list_58.html">女装
- http://business.chinasszx.com/brands/list/list_59.html">童装
- http://business.chinasszx.com/brands/list/list_61.html">休闲
- http://business.chinasszx.com/brands/list/list_62.html">内衣
- http://business.chinasszx.com/brands/list/list_66.html">鞋业
- http://business.chinasszx.com/brands/list/list_68.html">珠宝
- http://business.chinasszx.com/brands/list/list_69.html">饰品
- http://business.chinasszx.com/brands/list/list_70.html">化妆
- http://www.chinasszx.com/fashion/Article/">风尚
- http://www.chinasszx.com/fashion/News/">服饰
- http://www.chinasszx.com/fashion/vSp/">奢品
- http://www.chinasszx.com/fashion/vTk/">图库
- http://www.chinasszx.com/fashion/vMr/">美容
- http://www.chinasszx.com/fashion/vXx/">休闲
- http://www.chinasszx.com/fashion/vXn/">型男
- http://www.chinasszx.com/fashion/Article/list/list_113.html">快讯
- http://www.chinasszx.com/n/">时尚新闻
- http://www.chinasszx.com/brand/">时尚品牌
- http://www.chinasszx.com/bizinfo.html">在线商机
- http://www.chinasszx.com/company.html">在线企业
- http://www.chinasszx.com/alliance.html">招商加盟
- http://www.chinasszx.com/fair.html">时尚展会
- 07-01· 北凉国的那些事(组诗)
- 07-01· 《乱世佛音》 第七章 巨变
- 07-01· 南匈奴始末(3)
- 06-30· 流浪在波希米尼亚
- 06-30· 希尼亚从大洋西岸放飞新
- 06-28· 瑪利亞之城 - 家庭日 "光
- 06-28· 至青年营弟兄姐妹的一封
- 06-26· 《三国群英大富翁》追忆
- 06-24· 东莞血汗工厂实录(281:沙田
- 06-22· 第一次看戏
- 06-22· 经典复刻,独一无二:试
- 06-22· 蓝旗营教学中心9月份盛大
- 06-22· 品牌折扣女装嫣然品牌折
- 06-21· IQVopdnkvdz 1100
- 06-21· kriyoylto8fyds'p;tyijyfuifiogoi
- 06-21· 巴黎春天缤纷圣诞 喜迎新
- 06-21· 晒JS宝宝贝贝些 咯
- 06-21· 司马氏的谥法和葬仪
- 06-21· [转载]司马氏的谥法和葬仪
- 06-21· 闲来蓟县看秋山