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

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

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

但是删除完之后下面不是又重新创建了吗?

if exists(select*from sys.objects where [name]='GetIndustrial')
drop proc GetIndustrial
把这个去掉,看存储过程能创建成功吗?估计是删除后并没有创建成功。
这是删除并创建的SQL语句,如果只是想修改的话可以通过SQL Server的企业管理器,找到对应的存储过程,然后单击右键》修改

if exists(select*from sys.objects where [name]='GetIndustrial')
drop proc GetIndustrial
go
改为Create or replace procedure GetIndustrial as
....