Sql Server - Delete ALL Stored Procedure in Database
//=================================================== GET ALL Stored PROCEDURE List SELECT 'DROP PROCEDURE ' + p.NAME FROM sys.procedures p //=================================================== DELETE ALL stored PROCEDURE 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 //====================================================
No comments:
Post a Comment