.rename column

Changes the name of an existing table column. To change the name of multiple columns, see below.

Syntax

.rename column [DatabaseName.]TableName.ColumnExistingName to ColumnNewName

Where DatabaseName, TableName, ColumnExistingName, and ColumnNewName are the names of the respective entities and follow the identifier naming rules.

rename columns

Changes the names of multiple existing columns in the same table.

Syntax

.rename columns Col1 = [DatabaseName.[TableName.Col2]] , ...

The command can be used to swap the names of two columns (each is renamed as the other's name.)

Note

rename columns only supports swapping exactly two columns.

Example

.rename columns TimeGenerated_archive = myDB.sampleData.TimeGenerated, TimeGenerated = myDB.sampleData.TimeGenerated_archive