Dhiraj
Dhiraj

Reputation: 3696

Kusto command for generating create table & function script

Kusto explorer does allow scripting out functions and tables using the UI option "make command script". Is there any way we can use some sort of Kusto command to generate exactly the same output? Basically looking for command counterpart for clicking "make command script".

Upvotes: 5

Views: 4299

Answers (2)

Daniel Dror
Daniel Dror

Reputation: 2507

Continuing Yoni's answer, this should give you an executable command

.show table MyTable cslschema | project strcat(".create table ",TableName," (", Schema , ")")
  • project lets you select what to output (same as SELECT in sql)

  • strcat lets you concat string

Upvotes: 5

Yoni L.
Yoni L.

Reputation: 25995

.show table T cslschema (doc) should bring you close to that

Upvotes: 3

Related Questions