Need help fixing bad data condition for database maintenance
Posted: Mon Nov 03, 2014 1:48 pm
Hi,
I just noticed this error in our AC error log over the weekend:
The DELETE statement conflicted with the REFERENCE constraint "ac_Addresses_ac_BasketShipments_FK1". The conflict occurred in database "AbleCommerce", table "dbo.ac_BasketShipments", column 'AddressId'. The statement has been terminated.
I looked into the AC help page for this (http://help.ablecommerce.com/upgrades/a ... enance.htm), but I am unable to resolve the issue. I tried running the SQL query to fix it, and the preview works and shows 89 records. When I change the @preview variable to 0 to delete the records, I get the following error:
Msg 547, Level 16, State 0, Line 39
The UPDATE statement conflicted with the FOREIGN KEY constraint "ac_Addresses_ac_BasketShipments_FK1". The conflict occurred in database "AbleCommerce", table "dbo.ac_Addresses", column 'AddressId'.
The statement has been terminated.
I'm not sure what to do now. Please help me resolve this.
I just noticed this error in our AC error log over the weekend:
The DELETE statement conflicted with the REFERENCE constraint "ac_Addresses_ac_BasketShipments_FK1". The conflict occurred in database "AbleCommerce", table "dbo.ac_BasketShipments", column 'AddressId'. The statement has been terminated.
I looked into the AC help page for this (http://help.ablecommerce.com/upgrades/a ... enance.htm), but I am unable to resolve the issue. I tried running the SQL query to fix it, and the preview works and shows 89 records. When I change the @preview variable to 0 to delete the records, I get the following error:
Msg 547, Level 16, State 0, Line 39
The UPDATE statement conflicted with the FOREIGN KEY constraint "ac_Addresses_ac_BasketShipments_FK1". The conflict occurred in database "AbleCommerce", table "dbo.ac_Addresses", column 'AddressId'.
The statement has been terminated.
I'm not sure what to do now. Please help me resolve this.