Recently I had a Synch issue during my deployment on a Dynamics 365 FO LBD Implementation.
This is the error:
Violation of PRIMARY KEY constraint ‘I_65518FIELD’. Cannot insert duplicate key in object ‘dbo.SQLDICTIONARY‘. The duplicate key value is (TABLEID, FIELDID, 1, 0).
It seems that already exist a field with the same FieldID!
With Microsoft Dynamics 365 FO I thought that issue like that doesn’t happen anymore.
However, against the Business Database exist a table named TABLEFIELDIDTABLE that list for each table the fieldId values.
From my side I notice that some of my custom field ids present on that table was different than the Ids listed on the SqlDictionary table.
Really strange..
So, I decide to update the SQLDictionary table according with the Id values coming from the TABLEFIELDIDTABLE table.
Lastly, I restarted my deployment from the same failed step.
Take a look here in order to understand how to rerun a specific Step without to rerun the entire process.
The same issue could occur also on a Cloud Deployment, like on your Tier 1 or UAT Environment
That’s it!
Original Post https://sinedax.blogspot.com/2018/05/violation-of-primary-key-constraint.html