Maintaining referential integrity when reassigning rows among subscribers

To cancel a sales relationship between a customer and a sales representative, a row in the Policy table is deleted. In this example, the Policy table change is properly replicated to the old sales representative. However, no change has been made to the Customers table, and so no changes to the Customers table are replicated to the old sales representative.

In the absence of triggers, this can leave a subscriber with incorrect data in their Customers table. The same kind of problem arises when a new row is added to the Policy table.

 Using triggers to solve the problem
 A BEFORE INSERT trigger
 A BEFORE DELETE trigger
 Multiple-valued subqueries
 Notes