DROP Command Reference
Description
Deletes various database objects in Singdata Lakehouse.
Syntax
Parameters
| Parameter | Description | Required |
|---|---|---|
<object_type> | The type of object to delete, such as TABLE, DYNAMIC TABLE, VIEW, etc. | Yes |
IF EXISTS | Silently skip if the object does not exist, without raising an error | No |
<identifier> | Object name, may include a schema prefix | Yes |
Supported Object Types
| Object Type | Drop Syntax | Recoverable | Recovery Syntax |
|---|---|---|---|
| Regular Table | DROP TABLE <name> | Yes | UNDROP TABLE <name> |
| Dynamic Table | DROP DYNAMIC TABLE <name> | Yes | UNDROP TABLE <name> |
| Materialized View | DROP MATERIALIZED VIEW <name> | Yes | UNDROP TABLE <name> |
| Table Stream | DROP TABLE STREAM <name> | Yes | UNDROP TABLE <name> |
| View | DROP VIEW <name> | No | -- |
| External Table | DROP EXTERNAL TABLE <name> | No | -- |
| Schema | DROP SCHEMA <name> | No | -- |
| External Schema | DROP EXTERNAL SCHEMA <name> | No | -- |
| Compute Cluster | DROP VCLUSTER <name> | No | -- |
| Connection | DROP CONNECTION <name> | No | -- |
| Data Share | DROP SHARE <name> | No | -- |
| Index | DROP INDEX <name> | No | -- |
| Function | DROP FUNCTION <name> | No | -- |
| External Function | DROP EXTERNAL FUNCTION <name> | No | -- |
| Synonym | DROP SYNONYM <name> | No | -- |
| User | DROP USER <name> | No | -- |
| Role | DROP ROLE <name> | No | -- |
Permission Requirements
Executing a DROP operation requires one of the following permissions:
OWNERSHIPpermission on the target object- Workspace-level
ADMINrole - Having been granted the corresponding
DROPpermission (via theGRANTcommand)
Notes
- Object type must match: Dropping a dynamic table requires
DROP DYNAMIC TABLE, and dropping a materialized view requiresDROP MATERIALIZED VIEW. Using the wrong type will result in an error. - Data recoverability: Regular tables, dynamic tables, materialized views, and Table Streams can be recovered with
UNDROP TABLEwithin the Time Travel retention period. - Cascading deletion:
DROP SCHEMAcascades to delete all objects under that Schema; no additionalCASCADEspecification is needed. - Dependency check: Before dropping a table, check whether any views, dynamic tables, Table Streams, or ETL tasks depend on that object.
Syntax Reference
Table Related
- DROP TABLE
- DROP DYNAMIC TABLE
- DROP MATERIALIZED VIEW
- DROP VIEW
- DROP EXTERNAL TABLE
- DROP TABLE STREAM
- UNDROP TABLE
