Updated on 2025-09-18 GMT+08:00

DROP SCHEMA

Function

DROP SCHEMA is specific to DataArts Fabric SQL. It is used to delete a database with a specified name from LakeFormation.

Precautions

If there is a large amount of user data, the statement execution may take a long time when schema data is deleted.

Syntax

1
DROP SCHEMA [ IF EXISTS ] schema_name [, ...] [ CASCADE | RESTRICT ];

Parameter Description

  • IF EXISTS

    Reports a notice instead of an error if the specified schema does not exist.

  • schema_name

    Name of the LakeFormation database.

  • CASCADE | RESTRICT
    • CASCADE: Recursively deletes all objects under the database object from LakeFormation.
    • RESTRICT: Only the database object is deleted. If the database object contains any object, the deletion fails. This is the default action.

Examples

Delete the test_schema database. If the database has cascading objects, an error is reported.

1
DROP SCHEMA test_schema;

Automatically deletes the test_schema database and all objects in the database.

1
DROP SCHEMA test_schema CASCADE;