使用这个存储过程可以实现分页的,新手可以看看哦!
create proc proPage(@pageid int ,@pagesize int)
as
begin
if (@pageid=1)
begin
set rowcount @pagesize
select * from test order by id
end
else
begin
declare @no1 int
declare @num int
select @num=@pagesize*(@pageid-1)
set rowcount @num
select @no1=id from test order by id
declare @no2 int
select @num=@pagesize*@pageid
set rowcount @num
select @no2=id from test order by id
set rowcount 0
select * from test where id>@no1 and id<=@no2
end
end
Word教程网 | Excel教程网 | Dreamweaver教程网 | Fireworks教程网 | PPT教程网 | FLASH教程网 | PS教程网 |
HTML教程网 | DIV CSS教程网 | FLASH AS教程网 | ACCESS教程网 | SQL SERVER教程网 | C语言教程网 | JAVASCRIPT教程网 |
ASP教程网 | ASP.NET教程网 | CorelDraw教程网 |