Venkatasubramanian S
Venkatasubramanian S

Reputation: 33

How to find using Kusto query language if a column name contains 'teams' in a database and return all table and column names?

I want to find out all the column names that contain 'teams' in a particular database using Kusto queries. The output should be the TableName and ColumnNames that satisfy this criteria.

Please help.

Upvotes: 3

Views: 4886

Answers (1)

Yoni L.
Yoni L.

Reputation: 25955

you can use .show database schema: https://learn.microsoft.com/en-us/azure/data-explorer/kusto/management/show-schema-database

for example:

.show database MyDatabase schema
| where ColumnName contains 'teams'
| project TableName, ColumnName

or

.show database MyDatabase schema
| where ColumnName contains 'teams'
| summarize Columns = make_list(ColumnName) by TableName

Upvotes: 9

Related Questions