Archive for July, 2009

A simple query will delete all SPs in the database. This query should be used with care and not for frequent use as well.

/*

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

*/