Click here to view and discuss this page in DocCommentXchange. In the future, you will be sent there automatically.
When rows are deleted from the consolidated database, there needs to be a record of the row so it can be removed from any remote databases that have the row. Two ways to do this are by using logical deletes or shadow tables.
Logical deletes With this method, the row is not deleted. Data that is no longer required is marked as inactive in a status column. The WHERE clause of the download_cursor and download_delete_cursor can refer to the status of the row.This technique is used in the ULEmpCust table in the CustDB sample application, in which the action column holds a D for Delete. The scripts use this value to delete the record from the remote database, and delete the record from the consolidated database at the end of the synchronization. CustDB also uses this technique for the ULOrder table, and the Contact sample uses the technique on the Customer, Contact, and Product tables.
Shadow tables With this method, you create a shadow table that stores the primary key values of deleted rows. When a row is deleted, a trigger can populate the shadow table. The download_delete_cursor can use the shadow table to remove rows from remote databases. The shadow table only needs to contain the primary key columns from the real table.
See Writing download_delete_cursor scripts.
Temporarily stopping the synchronization of deletes