Is there a way to combine the two primary keys into one, and then cascade to update all the affected relationships? Here's the script:
Customers (idCustomer int PK, varchar (50), etc.)
CustomerContacts (idCustomerContact int PK, idCustomer int FK, name varchar (50), etc.)
CustomerNotes (idCustomerNote int PK, idCustomer int FK, note text, etc.)
Sometimes customers need to be combined into one. For example, you have a client with identifier 1, and the other with identifier 2. You want to combine both, so that everything that was 2 is now 1. I know I can write a script that updates all the affected tables one by one, but I would like to make this a more promising proof using cascade rules, so I don't need to update the script every time a new relationship is added.
Any ideas?
source share