How to drop stored procedure in SQL?
Syntax
To drop a procedure using the DROP PROCEDURE statement, here is the generic syntax:
DROP PROCEDURE [IF EXISTS] stored_produre_name;
In some cases, you might also specify the schema containing the stored procedure:
DROP PROCEDURE [IF EXISTS] [schema_name.]stored_produre_name;
Example
In SQL Server, to list all stored procedure and find the one you need to drop:
SELECT name AS procedure_name
,SCHEMA_NAME(schema_id) AS schema_name
,type_desc
,create_date
,modify_date
FROM sys.procedures;
To drop the procedure name_update
:
DROP PROCEDURE name_update;
Need a good GUI tool for databases? TablePlus provides a native client that allows you to access and manage Oracle, MySQL, SQL Server, PostgreSQL and many other databases simultaneously using an intuitive and powerful graphical interface.
Not on Mac? Download TablePlus for Windows.
Need a quick edit on the go? Download for iOS