Set statement
The set statement is used to set a request property for the duration of the query.
Request properties control how a query executes and returns results. They can be boolean flags, which are false by default, or have an integer value. A query may contain zero, one, or more set statements. Set statements affect only the tabular expression statements that trail them in the program order. Any two statements must be separated by a semicolon.
Request properties aren’t formally a part of the Kusto Query Language and may be modified without being considered as a breaking language change.
Syntax
set OptionName [= OptionValue]
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
| OptionName | string | ✔️ | The name of the request property. |
| OptionValue | ✔️ | The value of the request property. |
Example
This query uses query_take_max_records to limit the number of records retrieved from the StormEvents table.
(This is somewhat equivalent to using a | take 100 operator.)
set query_take_max_records=100;
StormEvents
Output
The table shows the first few results.
| 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 |
| … | … | … | … | … | … |
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.