Datamaker: Violation of PRIMARY KEY constraint 'gtrep_clob_pk'. Cannot insert duplicate key in object 'dbo.gtrep_clob'.

Document ID : KB000005959
Last Modified Date : 14/02/2018
Show Technical Document Details
Issue:

We are trying to use the copy repository function to copy the projects between environments. However, this does not copy the saved sql programs. After the copying everything else, we try to create the sql programs manually, but it conflicts with existing data and we receive the following error message:

Database Error Message: SQLSTATE = 23000 
Microsoft SQL Server Native Client 10.0 
Violation of PRIMARY KEY constraint 'gtrep_clob_pk'. Cannot 
insert duplicate key in object 'dbo.gtrep_clob'. The duplicate 
key value is (xxxx). 

Transaction Error Code: -1 
Database Error Code: 2627 

Environment:
CA Test Data Manager (TDM)- Datamaker
Resolution:

To resolve this, we suggest that you reset your sequences in the Maintain Connections window. You can get to this window by pressing ‘Ctrl + Alt + M’ on your keyboard, like when performing repository maintenance. 

reset sequences.png

It should also be noted that the copy function should also copy stored SQL programs. If this is not happening, please reach out to support so that we can investigate the potential defect. 

Additional Information:

If you experience any further issues, please open a support case by going to https://www.ca.com/us/services-support/ca-support/contact-support.html.