Fix for Violation of Primary Key Constraint Error

By - Updated February 22, 2017


When user posts in Apps, an error message pops out stating violation of primary key constraint.


This issue is related to a bug with SQL Server. The details can be read here.

FIX: Sequence object generates duplicate sequence values when SQL Server 2012 or SQL Server 2014 is under memory pressure

Please manually reset the identity column for the table with the issue.

First, use the following query to check the current identity value of the fact table stated in the message.

Then, reset the identity value to a number that is greater than the current value.

In order to mitigate this issue going forward, please apply the latest Cumulative Update on your SQL server.