How to delete all stored procedures in a database using T-SQL

To delete a Stored procedure, use the following command

DROP PROCEDURE <PROCEDURE_NAME>;

To get the drop commands for all proceedures stored in a database, execute the following

SELECT 'DROP PROCEDURE '+ s.NAME+ '.' + p.NAME FROM SYS.PROCEDURES p ,SYS.SCHEMAS s

WHERE p.SCHEMA_ID = s.SCHEMA_ID


Then copy the result set, past it in a new window and execute it.



Alternate Titles: Delete all Stored Procedures,Drop all stored procedure in a database, drop stored procedure SQL SERVER.