all groups > sql server replication > march 2006 >
You're in the

sql server replication

group:

Foreign key constraint caused data loss


Foreign key constraint caused data loss paulysc
3/20/2006 8:48:29 AM
sql server replication:
I set up merge replication but never change all the foreign key
constraints to have the "Not for replication" attribute, we had
this up and running for a couple of weeks prior to finding out that the
foreign key constraint would fire during the replication process at
times when it seemed to do the inserts in a illogical order (child data
prior to the parent data) the end result was the sync process would
delete some child data. I was able to recover some data from the
conflict resolve but I need to know is there a way I can recover more
then the couple of days that was stored in the conflict tables?
Anybody have any suggestions. I also dropped every foreign key
constraint and trigger in the system and added back with the "Not for
replication" attribute, going forward my data loss issue has been
resolved.
Re: Foreign key constraint caused data loss paulysc
3/20/2006 10:28:41 AM
OK, I was looking to see if anybody knew of some magic. Thanks for you
help.

Pauly C

[quoted text, click to view]
Re: Foreign key constraint caused data loss Hilary Cotter
3/20/2006 12:11:17 PM
unfortunately there is no way other than a resync.

--
Hilary Cotter
Director of Text Mining and Database Strategy
RelevantNOISE.Com - Dedicated to mining blogs for business intelligence.

This posting is my own and doesn't necessarily represent RelevantNoise's
positions, strategies or opinions.

Looking for a SQL Server replication book?
http://www.nwsu.com/0974973602.html

Looking for a FAQ on Indexing Services/SQL FTS
http://www.indexserverfaq.com



[quoted text, click to view]

Re: Foreign key constraint caused data loss Paul Ibison
3/20/2006 5:07:15 PM
Your best bet would be to drop the publication, manually synchrionize the
data then do a nosync initialization. Also, if you are using SQL Server 2005
you can specify the article processing order which may avoid this need to
use the NFR attribute.
Cheers,
Paul Ibison SQL Server MVP, www.replicationanswers.com
(recommended sql server 2000 replication book:
http://www.nwsu.com/0974973602p.html)

AddThis Social Bookmark Button