Dela via


DROP PROCEDURE (U-SQL)

Summary

The DROP PROCEDURE statement drops the specified procedure.

Warning

This operation cannot be undone!

Syntax

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

Remarks

  • 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 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.

Examples

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

DROP PROCEDURE IF EXISTS TestReferenceDB.dbo.myFirstStoredProc;

See Also