Drop/Clear all procedure in sql server

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
    exec('drop procedure ' + @procName)
    fetch next from cur into @procName
end
close cur

deallocate cur

Comments

Popular posts from this blog

Unable to perform operation on the item is locked in workspace

Insecure cookie setting: missing Secure flag

Display Canvasjs Line Chart using Data from Database