Skip to main content
Solved

Violation of PRIMARY KEY constraint 'UPHistory_PK'.

  • May 18, 2023 10:24 AM UTC
  • 3 replies
  • 336 views
  • Translate All

Michael Ndungipartnerhold
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

3 replies

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • May 18, 2023 10:58 AM UTC

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.

 

Translate

Michael Ndungipartnerhold
Varsity I
Forum|alt.badge.img

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?

Translate

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

Hi @development93 

Thanks

Translate