Foreign Key Constraint Error in Categories Table

For general questions and discussions specific to the AbleCommerce 7.0 Asp.Net product.
Post Reply
User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Foreign Key Constraint Error in Categories Table

Post by jsmits » Tue Nov 09, 2010 9:06 am

I am getting the error message while trying to setup replication as detailed here.

The problem seems to be that the root categories have a CategoryId of 0 in ac_CatalogNodes table and that in ac_Categories there is no CategoryId = 0.

Has anyone experienced this and/or know of a work around?

HaterTot
Ensign (ENS)
Ensign (ENS)
Posts: 10
Joined: Sat Sep 25, 2010 6:56 pm

Re: Foreign Key Constraint Error in Categories Table

Post by HaterTot » Tue Nov 09, 2010 1:37 pm

I was about to recommend that you try removing the foreign key constraint. This is a bit dangerous. I'd bet though that if you tested the whole category system and it worked fine after this change, you wouldn't have much to worry about. The constraint is already being violated as it is.

But then I took a look at the key's properties in Sql Management Studio. Bear in mind, I know very little about databases... but from the looks of the properties it looks like this key does nothing BUT prevent you from replicating! I would say just flick the property "Enforce For Replication" from yes to no and try again :)

User avatar
jsmits
Lieutenant (LT)
Lieutenant (LT)
Posts: 66
Joined: Wed Sep 30, 2009 11:57 am

Re: Foreign Key Constraint Error in Categories Table

Post by jsmits » Tue Nov 16, 2010 12:18 pm

Thanks for your input, I changed the property per your suggestion but it quickly became apparent that there were many keys that also caused this error. Ultimately we changed the replication scheme to get around the issue.

Post Reply