Quantcast
Channel: SQL Server Replication forum
Viewing all articles
Browse latest Browse all 4054

How to solve conflict cause by constraint foreign key in replication.

$
0
0

Dear all.

I have a problem when setup a replication to synchronize between two database.My database has two tables, these are:

Bill_list(Bill_ID,Bill_Name)

Bill_details(Bill_ID,Detail_ID,Good_name,Quantity,Price)

The Bill_details table have a constraint (reference, foreign key) from Bill_details Bill_ID to Bill_listBill_ID.  When I use my software to delete a Bill it will delete record both in Bill_list table and the correspondence in Bill_details table, but when the merge agent do replication on the synchronize server,it can only delete Bill_details record and can't delete record in Bill_list, it show an error message "Can't not delete in Bill_list table because constraint ...", I can solve this problem by click "Submit Loser" button by hand but after delete all records in Bill_details table there will be no reference to the correspondence record in Bill_list table and in the next sync time, this record must be delete. Is there anyway to solve this problem automatically by merge agent and don't have to do this by hand.

Best regards.

Thanks.


Viewing all articles
Browse latest Browse all 4054

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>