删除所有存储过程的sql语句

 
2008-06-16 18:17 来自 dudu
 
 [code]
     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

            if @procName <> 'DeleteAllProcedures'

                  exec('drop procedure ' + @procName)

                  fetch next from cur into @procName

      end

      close cur

      deallocate cur

posted on 2012-08-17 10:45  Tyler Wang  阅读(306)  评论(0编辑  收藏  举报