{"title":"MaintainSqlIndex Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-maintainsqlindex-property/","by":"JOP-AL","license":"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-maintainsqlindex-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.","credit":"Microsoft Corporation, CC BY 4.0","origin":"https://learn.microsoft.com/en-us/dynamics365/business-central/dev-itpro/developer/properties/devenv-maintainsqlindex-property","source":{"name":"Business Central developer and IT pro docs","repo":"https://github.com/MicrosoftDocs/dynamics365smb-devitpro-pb","commit":"828b6ee72fcd75755627cd6011f3d20899217ab2","date":"2026-11-19"},"checked":"2026-11-19","description":"Sets a value that indicates whether a SQL Server index that corresponds to the fields part of the Dynamics 365 Business Central key should be created.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":211,"chars":25},{"level":2,"title":"Property Value","slug":"property-value","at":236,"chars":167},{"level":2,"title":"Syntax","slug":"syntax","at":403,"chars":100},{"level":2,"title":"Remarks","slug":"remarks","at":503,"chars":976},{"level":2,"title":"Related information","slug":"related-information","at":1479,"chars":40}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets a value that indicates whether a SQL Server index that corresponds to the fields part of the Dynamics 365 Business Central key should be created.\n## Applies to\n Table key\n## Property Value\nSet to True to create the SQL Server index on the field list defined in the key property. If set to false, no index is created. The default is true.\n## Syntax\n```al\nkey(<key name>;<comma-separated field list>) { MaintainSqlIndex=[false|true]; }\n```\n## Remarks\nIn Dynamics 365 Business Central, you can use a key to sort data in a table by the set of fields specified in the key. SQL Server can sort data without an index on the fields to be sorted. However, if an index exists, sorting by the fields matching the index will be faster, but modifications to the table will be slower. The more indexes there are on a table, the slower the modifications become.\nIn situations where a key must be created to allow only occasional sorting (for example, when running infrequent reports), set this property to false to prevent slow modifications to the table.\nThis property is mostly used in the case where the key definition is for a SIFT index. Here, the developer can control if only the SIFT index shall be created (set MaintainSQLIndex = false) or if a SQL index should also be created (MaintainSQLIndex = true).\n> NOTE\n> You cannot disable this property on the primary key of a table. This key is always created in SQL Server.\n## Related information\ndevenv-properties"}