Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
In this article
Applies to: ✅ Azure Data Explorer
Changes the name of existing table columns.
You must have at least Table Admin permissions to run this command.
.rename
column
[ DatabaseName.
]TableName.
CurrentColumnName to
NewColumnName
.rename
columns
NewColumnName =
[ DatabaseName.
]TableName.
CurrentColumnName ,
...
Note
.rename
columns
only supports swapping the names of exactly two existing columns.
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
DatabaseName | string |
The name of the database that contains the table with the column to rename. If not provided, the current context database is used. | |
TableName | string |
✔️ | The name of the table containing the column to rename. |
CurrentColumnName | string |
✔️ | The name of the column to rename. |
NewColumnName | string |
✔️ | The new name for the column. The name must follow the identifier naming rules. |
The following command swaps the names of the TimeGenerated_archive
column and the TimeGenerated
column.
.rename columns TimeGenerated_archive = myDB.sampleData.TimeGenerated, TimeGenerated = myDB.sampleData.TimeGenerated_archive