Uncategorized

Drop all stored procedures in database

Transact-SQL DECLARE @Stmt NVARCHAR(MAX) SET @Stmt = '' SELECT @Stmt = @Stmt + 'DROP PROCEDURE [' + s.name + '].[' + v.name + '];' FROM sys.Procedures v INNER JOIN sys.schemas s ON s.schema_id = v.schema_id EXECUTE (@Stmt) GO SELECT * FROM sys.procedures GO 12345678910111213 DECLARE @Stmt NVARCHAR(MAX) SET @Stmt = '' SELECT  @Stmt = @Stmt + 'DROP PROCEDURE [' + s.name + '].[' + v.name + '];' FROM sys.Procedures v INNER JOIN sys.schemas s ON s.schema_id = v.schema_id EXECUTE (@Stmt)GO SELECT * FROM sys.proceduresGO