识别在SQL DB中插入,更新,删除更改及其记录 [英] Identify Insert, update, delete changes and its records in SQL DB

查看:104
本文介绍了识别在SQL DB中插入,更新,删除更改及其记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我想识别数据库中的DML(插入,更新,删除)更改以及SQL数据库中修改的特定表中的记录。



我来自变更数据捕获,但是这样我找不到修改过的记录。



请帮助。



问候,

DhivyaJ

Hi,

I want to identify the DML(Insert, update, delete) changes in a database along with the records in a particular table modified in SQL database.

I came accross Change Data Capture but in that way I cannot find the records modified.

Pls help.

Regards,
DhivyaJ

推荐答案

有很多在sql中执行任务的功能很好。

TRIGGER。



这是代码项目的好文章...

触发器 - Sql Server [ ^ ]



这里是非常好的触发器视频和实际示例。

http://www.youtube.com/watch ?v = JNb54seLzZY [ ^ ]



希望这个帮助你。

---------------------

Pratik Bhuva
There is very Good Functionality in sql to do the task.
TRIGGER.

Here is Good Article from codeproject...
Triggers -- Sql Server[^]

And Here is very good video for Triggers with practical examples.
http://www.youtube.com/watch?v=JNb54seLzZY[^]

Hope This Help You.
---------------------
Pratik Bhuva


如果您想要行数据,那么您可以选择触发器。在sql server里面你可以找到新的/删除/修改过的记录。



里面触发你找到2个名为INSERTED和DELETED的特殊表。 SQL服务器自动创建和管理两个表,两者都有相同的结构。



从这些表中你可以收集旧的/删除的和新的行。



http://stackoverflow.com / questions / 3336319 / using-inserted-and-deleted-tables-in-the-triggers [ ^ ]
If you want row data then you can go for trigger. inside sql server you can find new/deleted/modifed records.

inside trigger you find 2 special tables named INSERTED and DELETED. SQL server automatically create and mange both tables and both have same structure.

From that tables you can collect old/deleted and new row.

http://stackoverflow.com/questions/3336319/using-inserted-and-deleted-tables-in-the-triggers[^]


这篇关于识别在SQL DB中插入,更新,删除更改及其记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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