I was told that we never delete records from the table, because it will be needed in future. and can I know is there any alternative than DELETE where I can DEACTIVATE the row than completely removing the row from table?
You can add a bit column to your tables - call it something like IsActive or IsDeleted
When you INSERT data make sure that the data is marked with the correct value:
New record - IsActive = true
- IsDeleted = false
Then when you what to make the records unavailable you will do an UPDATE to flag the records the opposite way:
Update - IsActive = false
- IsDeleted = true
When you run your queries you will filter the data out according to this flag. We implement this type of soft delete throughout our system and it works to hide records.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With