Set 语句Set statement

set 语句用于设置查询持续时间的查询选项。The set statement is used to set a query option for the duration of the query. 查询选项控制查询的执行方式并返回结果。Query options control how a query executes and returns results. 它们可以是布尔标志(默认关闭),也可以是整数值。They can be Boolean flags (off by default), or have an integer value. 一个查询可以包含零个、一个或多个 Set 语句。A query may contain zero, one, or more set statements. Set 语句仅影响按程序顺序尾随这些语句的表格表达式语句。Set statements affect only the tabular expression statements that trail them in the program order.

  • 还可以通过在 ClientRequestProperties 对象中设置查询选项以编程方式启用查询选项。Query options can also be enabled programmatically by setting them in the ClientRequestProperties object. 请参阅See here.

  • 查询选项并不是 Kusto 语言的正式组成部分,可以修改它,且不会视为中断语言的更改。Query options are not formally a part of the Kusto language, and may be modified without being considered as a breaking language change.


set OptionName [= OptionValue]set OptionName [= OptionValue]


set querytrace;
Events | take 100

Azure Monitor 不支持此功能This capability isn't supported in Azure Monitor