如何捕获表中的更新值 [英] How to Capture updated values in table

查看:109
本文介绍了如何捕获表中的更新值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好


我想通过显示具有更新值的旧值来显示用户对表数据所做的修改,任何机构都可以告诉我如何实现此功能


thx

Hi All


I want to show the modification made by the user to table data by showing old value with updated value , can any body tell me how can I achieve this


thx

推荐答案

这是跟踪修改日志或备份旧数据以备将来使用的好主意.
为此,您需要这样做...

1)首先,您需要添加一个表,该表将用于存储旧值,然后再进行更新.....

像这样的架构...

ID,TABLENAME,COLUMNAME,RecordID,OLDVALUE,UPDATEDVALUE

//这里记录ID表示记录的主键或ID

2)然后创建一个触发器,该触发器将在修改旧数据之前执行操作以备份您的旧数据....

3)然后您可以使用该备份数据来显示具有更新值的旧值...

有关触发器的更多信息,请参考此链接...

如何检查是否插入或插入 [ ^ ]
Thats great idea to track log of modification or back up you old data for future use....

for achieving this you need to do like this...

1) first of all you need to add one table, that table will used for storing old value before it will be updated.....

Schema Like this...

ID,TABLENAME,COLUMNAME,RecordID,OLDVALUE,UPDATEDVALUE

//here Record ID means the primary key or id of your record

2) then create a trigger that will perform operation for backup your old data before modified that....

3) then you can use that backup data for for showing old value with updated value...

For more about trigger you can please refer this link...

how to check whether it is inserte or update or delete in how to check whether it is update or delete in sql server trigger..?[^]


这篇关于如何捕获表中的更新值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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