Return to Snippet

Revision: 66252
at April 5, 2014 02:16 by ironcrema


Initial Code
declare @procName varchar(500)
declare cur cursor 

for select [name] from sys.objects where type = 'p' and name like '%sp_%'
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

Initial URL

                                

Initial Description
Drop store procedures

Initial Title
Drop store procedures by name contains

Initial Tags
sql, server

Initial Language
SQL