Violation of PRIMARY or UNIQUE KEY constraint INTEG_524 on table DIYDEBTOR in Delphi when create or delete Debtor

Created by Jason Lee, Modified on Tue, 12 Oct, 2021 at 12:32 PM by Jason Lee

Scenario 

Delphi create new Debtor or delete existing Debtor encountered “Violation of PRIMARY or UNIQUE KEY constraint INTEG_524 on table DIYDEBTOR in Delphi when create or delete Debtor”

 

Solution 

1. Make sure all users have logout from the database

2. You (administrator) alone login to the database

3. Go to File > Utilities > QNE Management Tools

4. Once QNE Management Tools opened up

5. Go to Tools > Intelligence SQL Queries

6. Tick “Overwrite Generated SQL”

7. Copy and paste below query into query box

DELETE FROM DIYDEBTOR

WHERE COMPANYCODE NOT IN (SELECT COMPANYCODE FROM DEBTOR)

8. Click “Execute SQL” button and click “Exit” button

9. Close QNE Management Tools

10. Now you can proceed to create new Debtor or delete existing Debtor without “Violation of PRIMARY or UNIQUE KEY constraint INTEG_524 on table DIYDEBTOR in Delphi when create or delete Debtor”



 

** Learn more about Azure Cloud

** Learn more about QNE Hybrid Cloud Software

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article