DROP PROCEDURE (U-SQL)
Updated: March 10, 2017
The DROP PROCEDURE statement drops the specified procedure.
This operation cannot be undone! |
| Syntax |
|---|
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 EXISTS
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 optionalIF EXISTSis 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.
Examples
- The examples can be executed in Visual Studio with the Azure Data Lake Tools plug-in.
- The scripts can be executed locally. An Azure subscription and Azure Data Lake Analytics account is not needed when executed locally.
- The examples utilize the procedures created from CREATE PROCEDURE (U-SQL).
// Will error if not exists DROP PROCEDURE TestReferenceDB.dbo.myStoredProcWithParameters; DROP PROCEDURE IF EXISTS TestReferenceDB.dbo.myFirstStoredProc;