Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Applies to:
Databricks SQL
Databricks Runtime 17.0 and above
Drops a user defined procedure.
Permissions
To drop a procedure, you must own it or have MANAGE on it, or own or have MANAGE on its parent schema or catalog. The usage privileges you also need depend on the object level at which you hold ownership or MANAGE. See Usage privilege requirements for MANAGE.
Syntax
DROP PROCEDURE [ IF EXISTS ] procedure_name
Parameters
-
The name of an existing procedure. The procedure name may be optionally qualified with a schema name.
IF EXISTS
If specified, no exception is thrown when the procedure does not exist.
Examples
-- Create a procedure `hello`
> CREATE PROCEDURE hello() SQL SECURITY INVOKER LANGUAGE SQL
AS BEGIN
SELECT 'hello!';
END;
-- Drop the procedure
> DROP PROCEDURE hello;
-- Try to drop a procedure which is not present
> DROP PROCEDURE hello;
Error: ROUTINE_NOT_FOUND
-- Drop a procedure only if it exists
> DROP PROCEDURE IF EXISTS hello;