Table of contents
Collapse the table of content
Expand the table of content


Michael Rys|Last Updated: 5/15/2018
4 Contributors

The DROP PROCEDURE statement drops the specified procedure.


This operation cannot be undone!

Drop_Proc_Statement :=                                                                                   
    'DROP' 'PROCEDURE' ['IF' 'EXISTS'] Identifier.

Semantics of Syntax Elements

  • Identifier
    Specifies the name of the procedure to be dropped. If the procedure name is a fully-specified three-part name, the procedure in the specified database and schema will be dropped. If the name is a two-part name, the procedure will be dropped in the current database context and specified schema. If the name is a simple identifier, then the procedure will be dropped in the current database and schema context.

    If a procedure of the given name does not exist, or the user has no permissions to drop the procedure, an error is raised. If the optional IF EXISTS is specified, then the statement drops the procedure if it already exists, or succeeds without changes if the procedure does not exist or the user has no permission to at least enumerate all existing procedures.


// Will error if not exists
DROP PROCEDURE TestReferenceDB.dbo.myStoredProcWithParameters;

DROP PROCEDURE IF EXISTS TestReferenceDB.dbo.myFirstStoredProc;

See Also

© 2018 Microsoft