Soft delete makes it much easier to restore the "deleted" value therefore offers more flexibility compared to a regular delete. On the other hand, you have to use more hard drive space to store all those soft deletions, but then again, you can restore those regular deletions by applying a backup of your database, so it's really supposed to be a business decision. There are pros and cons for both approaches, depending on what your priorities are.
Are soft deletes a good idea?
2 Answers By Expert Tutors
Marco H. answered 04/10/19
Sr. Data Eng. SQL Expert in Designing DB and Developing SQL
I would suggest creating another table in which all deleted data are resided. To accomplish this task, an After Update trigger needs to be created in the real-time table on a field/attribute that is being flagged as Delete. Once that filed is flagged as Delete, After Update trigger will be automatically fired and the entire record will be moved to another table (e.g. tblDeleted) and the current record of real-time table will be deleted. Conversely, you will need to create another After Update for Deleted records in the deleted table in which a record being flagged as Undelete will be moved back to its original real-time table and will be removed from the deleted table. To delete records physically and forever from disk, you can create a Stored Procedure by which scheduled checking can be done automatically on the records in tblDeleted table. For example, a record will be physically removed when it gets close its lifetime threshold.
Still looking for help? Get the right answer, fast.
Get a free answer to a quick problem.
Most questions answered within 4 hours.
OR
Choose an expert and meet online. No packages or subscriptions, pay only for the time you need.