Skip to main content
Solved

Violation of PRIMARY KEY constraint 'UPHistory_PK'.


Michael Ndungi
Varsity I
Forum|alt.badge.img

Hello everyone,
I’m trying to create a new instance of an existing database but I get an exception with the following error.

Kindly assist



Violation of PRIMARY KEY constraint 'UPHistory_PK'. Cannot insert duplicate key in object 'dbo.UPHistory'. The duplicate key value is (5).
The statement has been terminated.
 --------------------------------------
 Inner Exception:
 Violation of PRIMARY KEY constraint 'UPHistory_PK'. Cannot insert duplicate key in object 'dbo.UPHistory'. The duplicate key value is (5).
 The statement has been terminated.
 




​​​​

From the database this is how the situation looks like;
 



NB:database was moved to a different server.

​​Any kind of response will be highly appreciated

Best answer by Manikanta Dhulipudi

Hi @development93 

Thanks

View original
Did this topic help you find an answer to your question?

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • 3377 replies
  • May 18, 2023

Hi @development93  Usually, we will get this issue when we try to insert the same details in the table, and due to key fields, it is throwing this error.

 


Michael Ndungi
Varsity I
Forum|alt.badge.img
Naveen Boga wrote:

Hi @development93  Usually, we will get this issue when we try to insert the same details in the table, and due to key fields, it is throwing this error.

 

since the table keeps history of application update.
would deleting the available data solve the issue?


Manikanta Dhulipudi
Captain II
Forum|alt.badge.img+13

Reply


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings