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
参考资料:[url]http://www.cnblogs.com/291099657/archive/2009/03/18/1415841.html[/url]
类似的,删除用户自定义表也可以这样删除,只要在sys.objects中找到相对应的类型即可