Accounting 2.0 - Prompted Message: Error during upgrade to 2.0-Invalid Data Definition Language Statement, error message is Violation of PRIMARY KEY constraint … The duplicate key value is (CR Default)

From AutoCount Resource Center

Question: When upgrade database from 1.9 to 2.0, error message prompted “Invalid Data Definition Language Statement, error message is Violation of PRMIARY KEY constraint … The duplicate key value is (CR Default). Why?

CR default1a.png

After clicking OK, another message prompted.

CR default2.png

Possible Reason:

This is due to the “CR Default” (document format name) is used in version 1.9, and in AutoCount 2.0 there is a new document called Consignment Return which is also using “CR Default” as its document numbering format name. When upgrade to 2.0, the system is unable to generate the document format for Consignment Return as the format name exists (and being used) in the system.


1) Login to AutoCount 1.9, change the CR Default name. Go to General Maintenance > Document Numbering Format Maintenance, look for the CR Default format, edit and change to CR Default 1.

CR default3.png

2) Should you see error message during the change of document format name, it is because the document format has been assign to voucher format of some of the Payment Methods.

CR default4.png

Go to General Maintenance > Payment Method Maintenance, temporary change all Document Numbering Format that assigned with “CR Default” to any other Document Numbering Format.

CR default5.png

Go back to the Document Numbering Format Maintenance, now you should be able to edit the document numbering format to CR Default 1.

CR default6.png

CR default7.png

Go back to Payment Method Maintenance and edit the document format to CR Default 1.

CR default8.png

3) Now, you may login to AutoCount Accounting 2.0 again and proceed with database upgrade.

By: Soh Wee 220812, Lay Swan 220826, P220829

Go to menu

IconAcc20.PNG AutoCount Accounting 2.0 & 2.1

IconAcc188.PNG AutoCount Accounting 1.8 / 1.9
Wiki-Payroll.png AutoCount Payroll
Wiki-POS.PNG AutoCount POS

Wiki-AOTG.PNG AutoCount On The Go
Wiki-Accounting-Plugin.png AutoCount Accounting Plug-In Documentations