# TopNumberOfRows Property
> Version: _Available or changed with runtime version 1.0._
Specifies the maximum number of rows to include in the resulting data set of a query.
## Applies to
 Query
## Property Value
An integer that specifies the maximum number of rows to include in the resulting dataset. The default value for this property is 0.
> NOTE
> A value of 0 is the same as leaving the property blank. If you set the value to 0, then there is no limit and all rows of the dataset are returned.
## Syntax
```al
TopNumberOfRows = 10;
```
## Remarks
You use the TopNumberOfRows property to limit the resulting dataset to the first set of rows that are generated for the query. For example, you can include only the first 10 or first 100 rows in the resulting dataset. The TopNumberOfRows property is useful for key performance indicators such as the top number of customers or sales.
You can also specify the number of rows to include in the dataset by calling the ../methods-auto/query/queryinstance-topnumberofrows-method from AL. The TopNumberOfRows method will overwrite the TopNumberOfRows property setting.
## Related information
../devenv-query-object
Linking and Joining Data Items<../devenv-query-links-joins>
Aggregating Data in Query Objects<../devenv-query-totals-grouping>
Filtering Data in Query Objects<../devenv-query-filters>
devenv-properties

Copyright (c) Microsoft Corporation. CC BY 4.0, https://creativecommons.org/licenses/by/4.0/; code samples MIT. From https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-topnumberofrows-property, MicrosoftDocs/dynamics365smb-devitpro-pb at 828b6ee (2026-11-19). Changed: includes filled in, links to this site, and for agents shortened without dropping a fact. https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-topnumberofrows-property/
