.net - Designing a way to audit changes to tables -
i want able audit activity performed on db tables (updates, inserts etc). effective way design this? 1 solution have in mind have audit table every table , use sql triggers insert previous value before table updated new value.
sql server version 2008 include built-in option looking for. named cdc or change data capture. can more information in bol (officially book-on-line) in first link or blog in sec link:
- https://technet.microsoft.com/en-us/library/bb522489(v=sql.105).aspx
- https://www.simple-talk.com/sql/learn-sql-server/introduction-to-change-data-capture-(cdc)-in-sql-server-2008/
there other options can use. in order choose best option need more information on system. if (1) can describe system architecture, , (2) information want store in auditing (do need user name or audit data self), (3) need keep history or events, (4) temporary needs or part of database structure (cdc create elements triggers , not fits temporary audit, better use extended event or profiler). cdc option audit data changes, if fits needs.
Comments
Post a Comment