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 的最佳实现是什么?


基础教程推荐
- 无法在 ubuntu 中启动 mysql 服务器 2021-01-01
- Sql Server 字符串到日期的转换 2021-01-01
- 在 VB.NET 中更新 SQL Server DateTime 列 2021-01-01
- SQL Server 中单行 MERGE/upsert 的语法 2021-01-01
- 将数据从 MS SQL 迁移到 PostgreSQL? 2022-01-01
- 如何在 SQL Server 的嵌套过程中处理事务? 2021-01-01
- ERROR 2006 (HY000): MySQL 服务器已经消失 2021-01-01
- SQL Server:只有 GROUP BY 中的最后一个条目 2021-01-01
- 使用pyodbc“不安全"的Python多处理和数据库访问? 2022-01-01
- SQL Server 2016更改对象所有者 2022-01-01