DROP SCHEMA (Databricks SQL)
Drops a schema and deletes the directory associated with the schema from the file system. An exception is thrown if the schema does not exist in the system.
While usage of SCHEMA
and DATABASE
is interchangeable, SCHEMA
is preferred.
Parameters
IF EXISTS
If specified, no exception is thrown when the schema does not exist.
-
The name of an existing schemas in the system. If the name does not exist, an exception is thrown.
RESTRICT
If specified, will restrict dropping a non-empty schema and is enabled by default.
CASCADE
If specified, will drop all the associated tables and functions.
Warning
To avoid accidental data loss, do not register a schema (database) to a location with existing data or create new external tables in a location managed by a schema. Dropping a schema will recursively delete all data files in the managed location.