.drop column command
Applies to: ✅ Azure Data Explorer
Removes a column from a table.
To drop multiple columns from a table, see drop multiple table columns.
Note
This command does not physically delete the data, and does not reduce the cost of storage for data that was already ingested.
Warning
This command is irreversible. All data in the column that is removed will no longer by queryable. Future commands to add that column back will not be able to restore the data.
Permissions
You must have at least Table Admin permissions to run this command.
Syntax
.drop
column
TableName.
ColumnName [ifexists
]
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
TableName | string |
✔️ | The name of the table containing the column to drop. |
ColumnName | string |
✔️ | The name of the column to drop. |
ifexists |
string |
If specified, the command won't fail on a non-existent column. |
Example
The following command will drop the Value
column from the Test
table, if such a column exists. If the column doesn't exist, the command will not fail.
.drop column Test.Value ifexists
Drop multiple table columns
Removes multiple columns from a table.
Note
This command does not physically delete the data, and does not reduce the cost of storage for data that was already ingested.
Warning
This command is irreversible. All data in the column that is removed will no longer by queryable. Future commands to add those columns back will not be able to restore the data.
Syntax
.drop
table
TableName columns
(
ColumnName [,
...] )
Learn more about syntax conventions.
Parameters
Name | Type | Required | Description |
---|---|---|---|
TableName | string |
✔️ | The name of the table containing the column to drop. |
ColumnName | string |
✔️ | The name of the column to drop. |
Example
The following command will drop the Value
and Item
columns from the Test
table.
.drop table Test columns ( Value, Item )