I am designing a rather large SQL 2k5 DB. I need to track changes on certain tables, and I also need the ability to "roll back" changes.
Heres and example of a table and its log/archive
UserRoles
---------
UserRoleID
UserID
RoleID
UserRolesArchive
----------------
UserRoleID
UserID
RoleID
dbAction [Insert,Update,Delete]
ActionDate
The archive table will be populated via triggers. I figure this would allow for an archive, so that we can see all values the record ever had, even if it doesnt exist anymore. And also allows us to "roll back" changes if a user messes something up or changes thier mind. The above is just a simple example, our main focus is the product pricing tables, which have lots of prices that change a lot.
Has anyone done a db like this and if so what are your thoughts? Is this an acceptable approach to this problem or is there something better/more standard?
Any and all comments are much appreciated.
Heres and example of a table and its log/archive
UserRoles
---------
UserRoleID
UserID
RoleID
UserRolesArchive
----------------
UserRoleID
UserID
RoleID
dbAction [Insert,Update,Delete]
ActionDate
The archive table will be populated via triggers. I figure this would allow for an archive, so that we can see all values the record ever had, even if it doesnt exist anymore. And also allows us to "roll back" changes if a user messes something up or changes thier mind. The above is just a simple example, our main focus is the product pricing tables, which have lots of prices that change a lot.
Has anyone done a db like this and if so what are your thoughts? Is this an acceptable approach to this problem or is there something better/more standard?
Any and all comments are much appreciated.