Best way to implement an audit trail in SQL Server?

后端 未结 7 2348
臣服心动
臣服心动 2020-11-27 03:23

I don\'t know if these requirements are standard or not but I\'m wondering is there a solution out there which can do the following:

  • For a specified set of tab
7条回答
  •  忘掉有多难
    2020-11-27 04:13

    I see 3 ways to achieve this:

    1. Triggers are the best solution at all.
    2. You can implement replication/log shipping for the table or the database which will always be a few mili seconds/seconds old copy of that table/database.
    3. Schedule differential backups as per the time duration old copy you need.

    With option '2', in case of any problem immediately you can turn off replication/log shipping and get a few seconds previous copy of exact data. With option '3', for example you have differential backup frequency of every 5 minutes, then in case of any problem you can recover 5 minutes old copy of correct data.

提交回复
热议问题