Applies to: ✅Microsoft Fabric✅Azure Data Explorer✅Azure Monitor✅Microsoft Sentinel
The set statement is used to set a request property for the duration of the query.
要求プロパティは、クエリの実行方法と結果を返す方法を制御します。 既定で false されるブール型フラグまたは整数値を指定できます。 クエリには任意の数の set ステートメントを含めることができます (含めなくてもかまいません)。 set ステートメントは、プログラムの順序で後にあるテーブル式ステートメントのみに影響します。 2 つのステートメントは、セミコロンで区切る必要があります。
要求プロパティは正式にはKusto 照会言語の一部ではなく、言語の破壊的変更と見なされずに変更される可能性があります。
Note
- To set request properties using T-SQL, see Set request properties.
- Kusto クライアント ライブラリを使用して要求プロパティを設定するにはKusto Data ClientRequestProperties クラスを参照してください。
Syntax
set
OptionName [=OptionValue]
Learn more about syntax conventions.
Parameters
| Name | タイプ | Required | Description |
|---|---|---|---|
| OptionName | string |
✔️ | 要求プロパティの名前。 |
| OptionValue | ✔️ | 要求プロパティの値。 |
Example
このクエリでは、 query_take_max_records を使用して、 StormEvents テーブルから取得されるレコードの数を制限します。
(これは、 | take 100 演算子を使用する場合と多少同じです)。
The examples in this article use publicly available tables in the help cluster, such as the
StormEventstable in the Samples database.
The examples in this article use publicly available tables, such as the
Weathertable in the Weather analytics sample gallery. ワークスペース内のテーブルと一致するように、クエリ例のテーブル名を変更する必要がある場合があります。
set query_take_max_records=100;
StormEvents
Output
この表は、最初のいくつかの結果を示しています。
| StartTime | EndTime | EpisodeId | EventId | State | EventType |
|---|---|---|---|---|---|
| 2007-01-15T12:30:00Z | 2007-01-15T16:00:00Z | 1636 | 7821 | OHIO | Flood |
| 2007-08-03T01:50:00Z | 2007-08-03T01:50:00Z | 10085 | 56083 | NEW YORK | Thunderstorm Wind |
| 2007-08-03T15:33:00Z | 2007-08-03T15:33:00Z | 10086 | 56084 | NEW YORK | Hail |
| 2007-08-03T15:40:00Z | 2007-08-03T15:40:00Z | 10086 | 56085 | NEW YORK | Hail |
| 2007-08-03T23:15:00Z | 2007-08-05T04:30:00Z | 6569 | 38232 | NEBRASKA | Flood |
| 2007-08-06T18:19:00Z | 2007-08-06T18:19:00Z | 6719 | 39781 | IOWA | Thunderstorm Wind |
| ... | ... | ... | ... | ... | ... |