{"title":"Align SQL table definitions","url":"https://jonas-paprotka.de/docs/dev-itpro/administration/migration-align-table-definitions/","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/administration/migration-align-table-definitions, 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/administration/migration-align-table-definitions","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":"Learn which SQL table definitions must match between Business Central on-premises and online databases before you run cloud migration.","date":"2026-11-17","meta":{"topic":"concept-article"},"outline":[{"level":1,"title":"Align SQL table definitions","slug":"align-sql-table-definitions","at":0,"chars":1855},{"level":2,"title":"Next steps","slug":"next-steps","at":1779,"chars":76}],"text":"# Align SQL table definitions\nFor successful cloud migration replication, the on-premises source tables and the corresponding online destination tables must have matching definitions for the following properties:\n Primary keys\n Field names and data types\nReplication also checks field lengths and reports incompatible lengths as column-mapping errors.\nIn the following example, MyField1 is the primary-key field. The fields being migrated must have matching names and data types in the source and destination, including the primary-key fields.\n```al\ntable 50100 MyTable\n{\n    fields\n    {\n        field(1; MyField1; Integer)\n        {\n        }\n        field(2; MyField2; Integer)\n        {\n        }\n    }\n\n    keys\n    {\n        key(Key1; MyField1)\n        {\n            Clustered = true;\n        }\n        key(Key2; MyField2)\n        {\n        }\n    }\n```\nOther properties of tables, like the following, are either not required to match or the difference can be handled by table mapping during cloud migration setup. See Define cloud migration table mappings<migration-table-mapping>.\n Different table names can be handled by table mapping. In the previous code snippet, the table name is MyTable.\n A subset of fields can be mapped to a different table or table extension. The fields being moved must still have matching names and data types.\n Table and field IDs don't have to match for SQL replication.\n Secondary keys don't have to match for SQL replication.\n> NOTE\n> These rules apply to cloud migration replication, not to an on-premises application or data upgrade. An on-premises upgrade has separate requirements for preserving table and field identities and handling schema changes. See Supported upgrade paths to Business Central releases<../upgrade/upgrade-paths>.\n## Next steps\nDefine cloud migration table mappings<migration-table-mapping>"}