"
Table Sync Failed for Table: RouteOperationPropertiesResourceRequirementStaging. Exception: System.InvalidOperationException: Database execution failed: The CREATE UNIQUE INDEX statement terminated because a duplicate key was found for the object name 'dbo.ROUTEOPERATIONPROPERTIESRESOURCEREQUIREMENTSTAGING' and the index name 'I_17244STAGINGIDX'. The duplicate key value is (5637144576, 6_Resource requirements for route operation properties, 6_Resource requirements for route operation properties-2019-08-20T12:21:09-B9A8188398E6401, 0).
"
Solution:
The error is due to the index allow duplicate property. In earlier version it didn't allow duplicate records in new version the problem is fixed and it does allow duplicate records. Because in my case I was taking data from newer version to older version I had to face this issue. Do following steps:
- On target VM (older version one), open SQL server and take backup of table 'RouteOperationPropertiesResourceRequirementStaging' data i.e. Generate script and in advanced property select Type of data script to 'Data only'.
- Delete truncate RouteOperationPropertiesResourceRequirementStaging table in target VM.
- On source VM (newer version one) go to 'AOSService > PackagesLocalDirectory > ApplicationSuite > Foundation > AxTables' and copy RouteOperationPropertiesResourceRequirementStaging. Paste and replace this element on target VM in same location.
- Build Application Suite and Application Foundation models and Synchronize database.
- After synchronization runs successfully copy and run the SQL insert query you took backup in step 1.
Comment if you need to need any help. Thanks.