一下代碼可以刪除全部SQL數據庫存儲過程
1.打開數據庫工具
2選擇新建查詢
3.選擇要刪除數據庫的名稱
4.代碼復制5. 以下是刪除所有存儲過程的代碼
DECLARE ProcCursor CURSOR FOR
select [name] from sysobjects where xtype='p' and [name] not in(
select [name] from sysobjects where [name] like 'sp_%' or [name] like 'xp_%')
Declare @iEnd int
Declare @i int
select @iEnd =count([name]) from sysobjects where xtype='p' and [name] not in(
select [name] from sysobjects where [name] like 'sp_%' or [name] like 'xp_%')
set @i=0
select @i,@iend
open ProcCursor
WHILE (@i < @iEnd) BEGIN
Declare @name varchar(50)
FETCH NEXT FROM ProcCursor into @name
--select @name
exec('drop proc '+@name)
--'drop proc [@name]
--select @i
set @i=@i+1
End
close ProcCursor
DEALLOCATE ProcCursor