获取触发触发器时正在更新或删除的行的列值 [英] Get column values for the row that is updating or deleting when trigger fired

查看:40
本文介绍了获取触发触发器时正在更新或删除的行的列值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我已经编写了用于更新和删除表的触发器.
当我更新记录时,将触发触发器,并且无论列值是已更新还是已删除还是未更新,我都希望获取该行的所有值.

如果我更新一个列的值,我也想获得整行,我将其插入另一张表以进行审计.

如果我不更新任何列值,则不应出于审计目的将该行插入另一张表中.



问候,

Hi,

I have written trigger for update and delete for a table.
When i update a record the trigger fires and i want to get all the values of the row regardless whether the column value is updated or deleted or not updated.

If i update one column value also i want to get entire row which i am inserting into the other table for audit purpose.

If i don''t update any column value i should not insert that row into the other table for audit purpose.



Regards,

推荐答案

看这里:
Look at this:
http://www.seemoredata.com/en/showthread.php?134-Example-of-BEFORE-UPDATE-trigger-in-Sql-Server-good-for-Type-2-dimension-table-updates[^]


这篇关于获取触发触发器时正在更新或删除的行的列值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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