Adding "Soft Delete" to an existing system

235 Views Asked by At

I have a system which contains a lot of stored procedures, functions which run of TableA, for example. We need a way of being able to delete these orders, but keeping them on record.

One option we've considered is having a Delete field in TableA then go through all the sprocs and functions adding:

WHERE Deleted=0

Another option we've considered is creating a view called something like v_TableA then going through and changing all the sprocs and functions to read from this view, rather than the table.

Both involve a lot of work, and will need to be remembered when making future changes to the system.

I'm hoping there is a better way of doing this something like:

SOFTDELETE FROM TableA

But I know this isn't possible. Any help would be much appreciated.

0

There are 0 best solutions below