change Azure Data Explorer table folder when renaming multiple tables

Viewed 23

When running the below command, I would like to change the folder of both tables.

Command

.rename tables Table1=Table2 ifexists, Table2=Table1

Prior to the rename command:

  • Table1 is in a folder called F1
  • Table2 is in a folder called F2

However, after the rename command is complete the table/folder combinations change like so:

  • Table1 is in a folder called F2
  • Table2 is in a folder called F1

I understand that I can change the folders after the fact (.alter table folder). Is there a way to achieve the desired outcome without running extra commands?

For example:

.rename tables Table1=Table2 folder='F1' ifexists, Table2=Table1 folder='F2'
1 Answers

there's currently no single command that can perform all of those operations in a single transaction. if this feature is important to you, you can raise a feature request @ https://aka.ms/adx.ideas.

that said, what you can do is execute a sequence of commands using the .execute database script command.

Related