DB Audit Trail的最佳实现是什么? [英] What is the best implementation for DB Audit Trail?

查看:91
本文介绍了DB Audit Trail的最佳实现是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

数据库审核跟踪将捕获用户的上次修改时间,修改日期和创建日期.

A DB Audit Trail captures the User Last Modified, Modified Date, and Created Date.

有几种可能的实现方式:

There are several possible implementations:

  • SQL Server触发器
  • 将UserModified,ModifiedDate,CreatedDate列添加到数据库,并在存储过程或插入",更新"语句中相应地包含逻辑.

如果您在答案中包含实现(或链接到),那将是很好的.

It would be nice if you include implementation (or link to) in your answer.

推荐答案

根据您正在执行的操作,您可能希望将审核从数据层移到数据访问层.它给您更多的控制权.

Depending on what you're doing, you might want to move the audit out of the data layer into the data access layer. It give you more control.

我在NHibernate和SqlServer的此处中问了类似的问题..

I asked a similar question wrt NHibernate and SqlServer here.

这篇关于DB Audit Trail的最佳实现是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆