删除所有存储过程

清华大佬耗费三个月吐血整理的几百G的资源,免费分享!....>>>

 DECLARE @procName VARCHAR(500)
DECLARE cur CURSOR FOR
  SELECT [name]
  FROM   sys.objects
  WHERE  type = 'p'

OPEN cur

FETCH next FROM cur INTO @procName

WHILE @@fetch_status = 0
  BEGIN
      EXEC('drop procedure ' + @procName)

      FETCH next FROM cur INTO @procName
  END

CLOSE cur

DEALLOCATE cur