if exists(select*from sys.objects where [name]='GetIndustrial')
drop proc GetIndustrial
go
create proc GetIndustrial
@currentIndex int,--当前页
@pagesize int,--显示的行数
@pageCount int output--总页码数
as
declare
@rowcount int
set @rowcount=(select count(*) from industrial)
if(@rowcount%@pagesize>0)
set @pagecount =(@rowcount/@pagesize)+1
else
set @pagecount=@rowcount/@pagesize
select*from
(
select row_number() over(order by id asc) as rankid,id,title,photo,remark from industrial
)
as industrialInfo where rankid >@currentIndex*@pagesize and rankid<=@currentIndex*@pagesize+@pagesize
以上是sql脚本,不知道哪里出现了问题,会自动删除