/ Published in: SQL

Drop store procedures
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
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
Comments
