What is the best implementation for DB Audit Trail?(DB Audit Trail 的最佳实现是什么?)
问题描述
数据库审计跟踪记录用户上次修改、修改日期和创建日期.
有几种可能的实现方式:
- SQL Server 触发器
- 向数据库添加 UserModified、ModifiedDate、CreatedDate 列,并相应地在存储过程或插入、更新语句中包含逻辑.
如果您在答案中包含实现(或链接到),那就太好了.
根据您在做什么,您可能希望将审计从数据层移到数据访问层.它为您提供更多控制权.
我在 NHibernate 和 SqlServer 这里问了一个类似的问题.>
A DB Audit Trail captures the User Last Modified, Modified Date, and Created Date.
There are several possible implementations:
- SQL Server Triggers
- Add UserModified, ModifiedDate, CreatedDate columns to the database and include logic in Stored Procedures or Insert, Update statements accordingly.
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.
I asked a similar question wrt NHibernate and SqlServer here.
这篇关于DB Audit Trail 的最佳实现是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:DB Audit Trail 的最佳实现是什么?


- SQL 临时表问题 2022-01-01
- 以一个值为轴心,但将一行上的数据按另一行分组? 2022-01-01
- 使用 Oracle PL/SQL developer 生成测试数据 2021-01-01
- 如何将 Byte[] 插入 SQL Server VARBINARY 列 2021-01-01
- 如何使用 pip 安装 Python MySQLdb 模块? 2021-01-01
- 在SQL中,如何为每个组选择前2行 2021-01-01
- 如何将 SonarQube 6.7 从 MySQL 迁移到 postgresql 2022-01-01
- 导入具有可变标题的 Excel 文件 2021-01-01
- 远程 mySQL 连接抛出“无法使用旧的不安全身份验证连接到 MySQL 4.1+"来自 XAMPP 的错误 2022-01-01
- 更改自动增量起始编号? 2021-01-01