T-SQL 支持T-SQL support

Kusto 查询语言 (KQL) 是首选查询语言。Kusto query language (KQL) is the preferred query language. 但是,T-SQL 支持对于无法轻易转换为使用 KQL 的工具很有用。T-SQL support, however, is useful for tools that can't be easily converted to use KQL.
T-SQL 支持也可供熟悉 SQL 的人偶尔使用。T-SQL support is also useful for casual use by people familiar with SQL.

Kusto 可以解释和运行具有一些语言限制的 T-SQL 查询。Kusto can interpret and run T-SQL queries with some language limitations.

备注

Kusto 不支持 DDL 命令。Kusto doesn't support DDL commands. 仅支持 T-SQL select 语句。Only T-SQL select statements are supported. 若要详细了解与 T-SQL 相关的主要差异,请参阅 SQL 已知问题For more information about the main differences with regards to T-SQL, see SQL known issues.

使用 T-SQL 从 Kusto.Explorer 查询Querying from Kusto.Explorer with T-SQL

Kusto.Explorer 工具支持对 Kusto 进行的 T-SQL 查询。The Kusto.Explorer tool supports T-SQL queries to Kusto. 若要指示 Kusto.Explorer 执行查询,请使用空的 T-SQL 注释行 (--) 开始查询。To instruct Kusto.Explorer to execute a query, begin the query with an empty T-SQL comment line (--). 例如:For example:

--
select * from StormEvents

从 T-SQL 到 Kusto 查询语言From T-SQL to Kusto query language

Kusto 支持将 T-SQL 查询转换为 Kusto 查询语言 (KQL)。Kusto supports translating T-SQL queries to Kusto query language (KQL). 这种转换有助于熟悉 SQL 的人员更好地了解 KQL。This translation can help people familiar with SQL to better understand KQL. 若要从一些 T-SQL select 语句返回等效的 KQL,请在查询之前添加 explainTo get back the equivalent KQL from some T-SQL select statement, add explain before the query.

例如,以下 T-SQL 查询:For example, the following T-SQL query:

--
explain
select top(10) *
from StormEvents
order by DamageProperty desc

生成以下输出:produces this output:

StormEvents
| sort by DamageProperty desc nulls first
| take 10