Delete all Stored Procedure at once

Delete all stored procedures at once

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 = 0begin
    exec('drop procedure ' + @procName)
    fetch next from cur into @procName
endclose cur
deallocate cur

 

Leave a Reply

Your email address will not be published. Required fields are marked *