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
The .alter-merge table
command:
- Secures data in existing columns
- Adds new columns,
docstring
, and folder to an existing table - Must run in the context of a specific database that scopes the table name
You must have at least Table Admin permissions to run this command.
.alter-merge
table
tableName (
columnName:
columnType [,
...])
[with
(
propertyName =
propertyValue [,
...])
]
Learn more about syntax conventions.
Name | Type | Required | Description |
---|---|---|---|
tableName | string |
✔️ | The name of the table to alter. |
columnName, columnType | string |
✔️ | The name of an existing or new column mapped to the type of data in that column. The list of these mappings defines the output column schema. |
propertyName, propertyValue | string |
A comma-separated list of key-value property pairs. See supported properties. |
Note
If you try to alter a column type, the command will fail. Use .alter column
instead.
Tip
Use .show table [tableName] cslschema
to get the existing column schema before you alter it.
Name | Type | Description |
---|---|---|
docstring |
string |
Free text describing the entity to be added. This string is presented in various UX settings next to the entity names. |
folder |
string |
The name of the folder to add to the table. |
- Existing data won't be modified or deleted
- New columns will be added to the end of the schema
- Data in new columns is assumed to be null
.alter-merge table MyTable (ColumnX:string, ColumnY:int)
.alter-merge table MyTable (ColumnX:string, ColumnY:int) with (docstring = "Some documentation", folder = "Folder1")
Use the .alter
table command when you wish to further redefine the table settings. For more information, see .alter table.