html5中文学习网

您的位置: 首页 > 网络编程 > ASP编程 » 正文

Asp用存储过程实现数据分页_ASP教程_编程技术

[ ] 已经帮助:人解决问题

一、创建表 tiku_koushic66HTML5中文学习网 - HTML5先行者学习网

if exists (select * from dbo.sysobjects where id =
object_id(N'[dbo].[tiku_koushi]') and OBJECTPROPERTY
(id, N'IsUserTable') = 1)
drop table [dbo].[tiku_koushi]
GO c66HTML5中文学习网 - HTML5先行者学习网

CREATE TABLE [dbo].[tiku_koushi] (
[id] [int] IDENTITY (1, 1) NOT NULL , c66HTML5中文学习网 - HTML5先行者学习网

[title] [varchar] (250) COLLATE c66HTML5中文学习网 - HTML5先行者学习网

Chinese_PRC_CI_AS NULL , c66HTML5中文学习网 - HTML5先行者学习网

[list2_id] [char] (10) COLLATE c66HTML5中文学习网 - HTML5先行者学习网

Chinese_PRC_CI_AS NULL c66HTML5中文学习网 - HTML5先行者学习网

) ON [PRIMARY] c66HTML5中文学习网 - HTML5先行者学习网

GO c66HTML5中文学习网 - HTML5先行者学习网

二、存储过程 sp_c c66HTML5中文学习网 - HTML5先行者学习网

CREATE proc sp_c
@tablename varchar(50),
@title varchar(250), c66HTML5中文学习网 - HTML5先行者学习网

@list2_id varchar(50) c66HTML5中文学习网 - HTML5先行者学习网

as c66HTML5中文学习网 - HTML5先行者学习网

if @tablename='tiku_koushi' c66HTML5中文学习网 - HTML5先行者学习网

select count(*) from tiku_koushi where title like '%' @title '%' and list2_id=@list2_id
GO c66HTML5中文学习网 - HTML5先行者学习网

三、存储过程 sp_search_tiku c66HTML5中文学习网 - HTML5先行者学习网

CREATE PROCEDURE sp_search_tiku c66HTML5中文学习网 - HTML5先行者学习网

@tablename varchar(50), c66HTML5中文学习网 - HTML5先行者学习网

@title varchar(250), c66HTML5中文学习网 - HTML5先行者学习网

@list2_id varchar(10), c66HTML5中文学习网 - HTML5先行者学习网

@pagesize int, c66HTML5中文学习网 - HTML5先行者学习网

@page int c66HTML5中文学习网 - HTML5先行者学习网

AS c66HTML5中文学习网 - HTML5先行者学习网

if @tablename='tiku_koushi' c66HTML5中文学习网 - HTML5先行者学习网

begin c66HTML5中文学习网 - HTML5先行者学习网

declare @ks int c66HTML5中文学习网 - HTML5先行者学习网

declare @str varchar(200) c66HTML5中文学习网 - HTML5先行者学习网

set @ks=@pagesize*(@page-1) c66HTML5中文学习网 - HTML5先行者学习网

if not exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[temp_table91]') and OBJECTPROPERTY(id, N'IsUserTable') = 1) c66HTML5中文学习网 - HTML5先行者学习网

begin c66HTML5中文学习网 - HTML5先行者学习网

select * into temp_table91 from tiku_koushi where
title like '%' @title '%' and list2_id=@list2_id order
by id desc c66HTML5中文学习网 - HTML5先行者学习网

set rowcount @pagesize c66HTML5中文学习网 - HTML5先行者学习网

set @str='select * from temp_table91 where id not in
(select top ' str(@ks) ' id from temp_table91)' c66HTML5中文学习网 - HTML5先行者学习网

execute(@str) c66HTML5中文学习网 - HTML5先行者学习网

drop table temp_table91 c66HTML5中文学习网 - HTML5先行者学习网

end c66HTML5中文学习网 - HTML5先行者学习网

end
GO c66HTML5中文学习网 - HTML5先行者学习网

四、search_koushi.asp c66HTML5中文学习网 - HTML5先行者学习网

else
%>
c66HTML5中文学习网 - HTML5先行者学习网

c66HTML5中文学习网 - HTML5先行者学习网

c66HTML5中文学习网 - HTML5先行者学习网
c66HTML5中文学习网 - HTML5先行者学习网
(责任编辑:)
推荐书籍
推荐资讯
关于HTML5先行者 - 联系我们 - 广告服务 - 友情链接 - 网站地图 - 版权声明 - 人才招聘 - 帮助