.create-merge 表.create-merge tables

允许你在特定数据库的上下文中,通过单个批量操作创建和扩展现有表的架构。Lets you create and extend the schemas of existing tables in a single bulk operation, in the context of a specific database.

备注

需要数据库用户权限Requires Database user permission. 需要表管理员权限来扩展现有表。Requires table admin permission for extending existing tables.

语法Syntax

.create-merge tables TableName1 ([columnName:columnType], ...) [, TableName2 ([columnName:columnType], ...) ... ].create-merge tables TableName1 ([columnName:columnType], ...) [, TableName2 ([columnName:columnType], ...) ... ]

  • 将创建不存在的指定表。Specified tables that don't exist will be created.
  • 已存在的指定表将扩展其架构。Specified tables that already exist will have their schemas extended.
    • 不存在的列将添加到现有表架构的末尾。Non-existent columns will be added at the end of the existing table's schema.
    • 此命令中未指定的现有列不会从现有表的架构中删除。Existing columns that aren't specified in the command won't be removed from the existing table's schema.
    • 在命令中使用与现有表架构中的数据类型不同的数据类型指定的现有列将导致失败。Existing columns that are specified with a data type in the command that is different from the one in the existing table's schemas will lead to a failure. 不会创建或扩展任何表。No tables will be created or extended.

示例Example

.create-merge tables
  MyLogs (Level:string, Timestamp:datetime, UserId:string, TraceId:string, Message:string, ProcessId:int32),
  MyUsers (UserId:string, Name:string)

返回输出Return output

TableNameTableName DatabaseNameDatabaseName 文件夹Folder DocStringDocString
MyLogsMyLogs TopComparisonTopComparison
MyUsersMyUsers TopComparisonTopComparison