Tracking changes in a SQL server 2005 database

前端 未结 8 1553
既然无缘
既然无缘 2020-12-29 00:05

I have been tasked with developing a solution that tracks changes to a database.

For updates I need to capture:

  • date of update
  • old value
8条回答
  •  臣服心动
    2020-12-29 00:40

    A trigger wouldn't have all the information you need for a bunch of reasons - but no user id is the clincher.

    I'd say you're on the right track with a common sp to insert wherever a change is made. If you're standardizing on sp's for your interfaces then you're ahead of the game - it will be hard to sneak in a change that isn't tracked.

    Look at this as the equivalent of an audit trail in an accounting application - this is the Journal - a single table with every transaction recorded. They wouldn't implement separate journals for deposits, withdrawals, adjustments, etc. and this is the same principle.

提交回复
热议问题