DROP Command Reference

Description

Deletes various database objects in Singdata Lakehouse.

Syntax

DROP <object_type> [ IF EXISTS ] <identifier>

Parameters

ParameterDescriptionRequired
<object_type>The type of object to delete, such as TABLE, DYNAMIC TABLE, VIEW, etc.Yes
IF EXISTSSilently skip if the object does not exist, without raising an errorNo
<identifier>Object name, may include a schema prefixYes

Supported Object Types

Object TypeDrop SyntaxRecoverableRecovery Syntax
Regular TableDROP TABLE <name>YesUNDROP TABLE <name>
Dynamic TableDROP DYNAMIC TABLE <name>YesUNDROP TABLE <name>
Materialized ViewDROP MATERIALIZED VIEW <name>YesUNDROP TABLE <name>
Table StreamDROP TABLE STREAM <name>YesUNDROP TABLE <name>
ViewDROP VIEW <name>No--
External TableDROP EXTERNAL TABLE <name>No--
SchemaDROP SCHEMA <name>No--
External SchemaDROP EXTERNAL SCHEMA <name>No--
Compute ClusterDROP VCLUSTER <name>No--
ConnectionDROP CONNECTION <name>No--
Data ShareDROP SHARE <name>No--
IndexDROP INDEX <name>No--
FunctionDROP FUNCTION <name>No--
External FunctionDROP EXTERNAL FUNCTION <name>No--
SynonymDROP SYNONYM <name>No--
UserDROP USER <name>No--
RoleDROP ROLE <name>No--

Permission Requirements

Executing a DROP operation requires one of the following permissions:

  • OWNERSHIP permission on the target object
  • Workspace-level ADMIN role
  • Having been granted the corresponding DROP permission (via the GRANT command)

Notes

  • Object type must match: Dropping a dynamic table requires DROP DYNAMIC TABLE, and dropping a materialized view requires DROP 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 TABLE within the Time Travel retention period.
  • Cascading deletion: DROP SCHEMA cascades to delete all objects under that Schema; no additional CASCADE specification 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

Compute and Connection

Index and Function

Other Objects