{"title":"SqlIndex Property","url":"https://jonas-paprotka.de/docs/dev-itpro/developer/properties/devenv-sqlindex-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-sqlindex-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-sqlindex-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 the actual fields that are used in the corresponding index on SQL Server.","date":"2026-10-01","meta":{"topic":"reference"},"outline":[{"level":2,"title":"Applies to","slug":"applies-to","at":139,"chars":25},{"level":2,"title":"Syntax","slug":"syntax","at":164,"chars":47},{"level":2,"title":"Remarks","slug":"remarks","at":211,"chars":744},{"level":2,"title":"Example","slug":"example","at":955,"chars":314},{"level":2,"title":"Related information","slug":"related-information","at":1269,"chars":61}],"text":"> Version: _Available or changed with runtime version 1.0._\nSets the actual fields that are used in the corresponding index on SQL Server.\n## Applies to\n Table key\n## Syntax\n```al\nSqlIndex = List of Fields;\n```\n## Remarks\nThis property allows you to define the fields that are used in the SQL index.\nThe fields in the SQL index can:\n Differ in number from the fields defined in the key in Dynamics 365 - there can be fewer fields or more fields.\n Be arranged in a different order.\nIf you use this property to define an index on a key that is not the primary key, then the index that is created contains exactly the fields that you specify and will not be a unique index. A unique index will only be created if it contains all of the primary key fields.\nIf you use this property to define an index for the primary key, it must include all the fields defined in the primary key. You can add extra fields and you can rearrange the fields to suit your needs.\n## Example\nThe following example uses the SQLIndex property on a primary key that includes two fields. The clustered index in the database will be ordered like this: (MyField2,MyField1).\n```al\nkeys\n{\n    key(PK; MyField1, MyField2)\n    {\n        Clustered = true;\n        SqlIndex = MyField2,MyField1;\n    }\n}\n```\n## Related information\ndevenv-properties\n../devenv-table-keys"}