Page 1 of 1
Foreign Key Constraint Error in Categories Table
Posted: Tue Nov 09, 2010 9:06 am
by jsmits
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?
Re: Foreign Key Constraint Error in Categories Table
Posted: Tue Nov 09, 2010 1:37 pm
by HaterTot
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

Re: Foreign Key Constraint Error in Categories Table
Posted: Tue Nov 16, 2010 12:18 pm
by jsmits
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.