.alter-merge table 命令

.alter-merge table 命令:

  • 保护现有列中的数据
  • 将新列、docstring 和文件夹添加到现有表中
  • 必须在指定表名范围的特定数据库的上下文中运行

权限

你必须至少具有表管理员权限才能运行此命令。

语法

.alter-mergetabletableName(columnName:columnType [, ...]) [with(propertyName=propertyValue [, ...])]

详细了解语法约定

参数

客户 类型​​ 必需 说明
tableName string 要更改的表的名称。
columnName, columnType string 映射到该列中数据类型的现有列或新列的名称。 这些映射的列表定义了输出列架构。
propertyName, propertyValue string 键值属性对的逗号分隔列表。 请参阅支持的属性

注意

如果尝试更改列类型,该命令将失败。 请改用 .alter column

提示

更改之前,请使用 .show table [tableName] cslschema 获取现有列架构。

支持的属性

名称 Type 描述
docstring string 描述要添加的实体的自由文本。 此字符串显示在实体名称旁边的各种 UX 设置中。
folder string 要添加到表的文件夹的名称。

此命令如何影响数据

  • 不会修改或删除现有数据
  • 新列将添加到架构的末尾
  • 新列中的数据将假定为 null

示例

.alter-merge table MyTable (ColumnX:string, ColumnY:int) 
.alter-merge table MyTable (ColumnX:string, ColumnY:int) with (docstring = "Some documentation", folder = "Folder1")

如果要进一步重新定义表设置,请使用 .alter table 命令。 有关详细信息,请参阅 .alter table