編輯

共用方式為


.alter-merge table command

Applies to: ✅ Microsoft FabricAzure 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

Permissions

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

Syntax

.alter-merge table tableName (columnName:columnType [, ...]) [with (propertyName = propertyValue [, ...])]

Learn more about syntax conventions.

Parameters

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.

Supported properties

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.

How the command affects the data

  • 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

Examples

.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.