如何存储数据更改的历史记录 [英] how to store history of data changes

查看:181
本文介绍了如何存储数据更改的历史记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我是.net的新手。我想知道如何存储由user.lets表示他们输入密钥的数据更改历史记录今天工作进展,然后明天他们再次键入更新状态。如何存储该历史记录,以便他们的经理可以稍后查看



提前感谢,
musiw。



im new to .net..i want to know how to store history of data changes that key in by user.lets say they key in today work progress, then tomorrow they key in again to update status.how to store that history so that their manager can view it later

thanks in advance,
musiw.

推荐答案

在SQLDatabase中创建更新触发器,并将更改存储在不同的表中,并将基表的主键作为FK。 触发器 - Sql Server [ ^ ]对您有用。
Create an update trigger in your SQLDatabase and store the changes in a different table with the primarykey of your base table as a FK.Triggers -- Sql Server[^]will be useful for you.


审计Trail 数据活动监控)是一种技术,通过它我们可以记录数据库中的所有用户活动。



请参考:

log4net教程 [ ^ ],这篇CP文章将为您提供简单易懂的演示。灵活使用Log4net。



另请查看:

使用ASP.NET和C#创建简单错误日志文件 [ ^ ] br />
本文演示如何创建一个简单的基于文本的日志文件来记录错误消息。



如何使用log4net [ ^ ]

本文介绍在Web应用程序中使用Log4net时应遵循的基本步骤。



在ASP中配置Log4Net .NET 2.0 [ ^ ]

本文介绍如何配置ASP.NET应用程序中的Log4Net。



对于数据库方面,在CP中你可以找到很多文章。在这里你去

用于Microsoft SQL的审计跟踪生成器 [ ^ ]

使用触发器实现审计跟踪 [ ^ ]

SQL Server 2008上的审计事件 [ ^ ]

审计跟踪 - 跟踪数据库中的数据更改 [ ^ ]

对MS SQL Server的审核2008 [ ^ ]



对于申请方,您可以使用下面的一个

五种记录方法 [ ^ ]
Audit Trail (Data Activity Monitoring) is a technique through which we can record all user’s activity on the database.

Please refer:
log4net Tutorial[^], This CP Article will give you demonstration of easy & flexible use of Log4net.

Also have a look on:
Create Simple Error Log Files using ASP.NET and C#[^]
This article demonstrates how to create a simple text based log file to log error messages.

How to use log4net[^]
This article describes the basic steps to be followed for using Log4net in a web application.

Configure Log4Net in ASP.NET 2.0[^]
This article explains how to configure Log4Net in an ASP.NET application.

For Database side, In CP you can find many articles. Here you go
Audit Trail Generator for Microsoft SQL[^]
Implementing Audit Trail using Trigger[^]
Auditing events on SQL Server 2008[^]
Audit Trail – Tracing Data Changes in Database[^]
Audits on MS SQL Server 2008[^]

For application side you may use the below one
Five methods to Logging[^]






尽管在使用SQLServer2005时解决方案1适合您。但是,如果您计划SQL Server 2008,那么您应该检查更改跟踪SQL Server 2008 [ ^ ]。它将存储高水平的变化历史。你不必再写代码了。



无论如何希望你能为你的牌桌创造触发器。



谢谢

-Amit Gajjar。
Hi,

Although Solution 1 works for you as you are using SQLServer2005. But if you are planning for SQL Server 2008 then you should check Change Tracking in SQL Server 2008[^]. it will store high level of change history. you do not have to write anymore code.

Anyway hope you will create triggers for your tables.

Thanks
-Amit Gajjar.


这篇关于如何存储数据更改的历史记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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