删除数据库中所用户创建的存储过程SQL

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 @ 2011-08-16 15:00  张宏宇  阅读(213)  评论(0编辑  收藏  举报