Hi guys,
Part of my table design is to include a IsDeleted BIT column that is set to 1 whenever a user deletes a record. Therefore all SELECTS are inevitable accompanied by a WHERE IsDeleted = 0 condition.
I read in a previous question (I cannot for the love of God re-find that post and reference it) that this might not be the best design and an 'Audit Trail' table might be better.
How are you guys dealing with this problem?
Update I'm on SQL Server. Solutions for other DB's are welcome albeit not as useful for me but maybe for other people.
Update2 Just to encapsulate what everyone said so far. There seems to be basically 3 ways to deal with this.
- Leave it as it is
- Create an audit table to keep track of all the changes
- Use of views with WHERE IsDeleted = 0