.drop table command

Applies to: ✅ Microsoft FabricAzure Data Explorer

Removes one or more tables from the database.

Note

The .drop table command only soft deletes the data. That is, data can't be queried, but is still recoverable from persistent storage. The underlying storage artifacts are hard-deleted according to the recoverability property in the retention policy that was in effect at the time the data was ingested into the table.

Permissions

You must have at least Table Admin permissions to run this command.

Syntax

.drop table TableName [ifexists]

.drop tables (TableName [, ... ]) [ifexists]

Learn more about syntax conventions.

Parameters

Name Type Required Description
TableName string ✔️ The name of the table to drop.
ifexists string If specified, the command won't fail if the table doesn't exist.

Returns

This command returns a list of the remaining tables in the database.

Output parameter Type Description
TableName string The name of the table.
DatabaseName string The database that the table belongs to.

Examples

Drop a single table

.drop table CustomersTable ifexists

Drop multiple tables

.drop tables (ProductsTable, ContactsTable, PricesTable) ifexists