I need a solution for the following problem:
I will have a table in SQL server 2008 that will be changing daily. It's a small table with maybe 5000 rows at most and around 5 fields.
The client will need the ability to view all the data in the table the way it was at a given point in time. For example "show me what all the data looked like in the table 2 weeks ago".
Someone had mentioned that auditing the table with http://autoaudit.codeplex.com/ would solve this problem.
My questions:
- Is there a solution to this problem that would involve simple auditing?
- If so, then how would i use auditing to solve this problem?
- Is there a different solution already in existence for this sort of challenge so that I do not have to reinvent the wheel?
Have an auditing table that get's manipulated by triggers. Something like:
And your trigger would look like this:
What this will allow you to do is query your audit table for a point in time. In other words, just use
DATEDIFF
to determine if a row was created prior to that given point in time, and deleted after it (or not deleted at all).EDIT
To query your audit table for point in time data: