declare proccur cursor for select [name] from sysobjects where type='P' declare @procname varchar(100) open proccur fetch next from proccur into @procname while(@@FETCH_STATUS = 0) begin if @procname like '%特殊字符%' begin exec('drop proc ' + @procname) --本句被注释,使用时请取消 print(@procname + '已被删除') end fetch next from proccur into @procname end close proccur deallocate proccur