NigelLiang 2015-02-02 01:25 采纳率: 50%
浏览 1796

自己创建的存储过程会自动删除,请高手帮忙

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脚本,不知道哪里出现了问题,会自动删除

  • 写回答

4条回答 默认 最新

  • bdmh 优质创作者: 移动开发技术领域 2015-02-02 01:29
    关注

    if exists(select*from sys.objects where [name]='GetIndustrial')
    drop proc GetIndustrial
    你这句话不就是自动删除吗,如果存在就删除

    评论

报告相同问题?