Updating parent and child tables

If I have a parent and child table, every time I change this record from the Front End, I delete the data in the child table and insert it again. I've been doing this for years, but now I wonder if this is the correct method or are there any better methods?

+3


source to share


1 answer


As far as I know, deleting parent and child records is not good practice, you can use either the following

Option 1

Transferring an old record to another table that has the same structure of the original table



Option 2

Add multiple columns (ex: Inactive default value "FALSE") to both child and parent tables before inserting a new record, update the old record as inactive, but if you are going to use this method, your program will change the logic

Hope this helps you ....

+1


source







All Articles