获取手动删除记录的日志 [英] getting log of deleting a record manually

查看:54
本文介绍了获取手动删除记录的日志的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,

如果有人从数据库(SQL-Server)中删除信息记录并手动创建另一条记录,我怎么能记录日志或其他类似的事情。

SQL-Server是否记录了被删除的记录或其他地方的其他信息?

谢谢和遗憾

Hi friends,
How i could take log or other things like that, When somebody delete a record of information from database(SQL-Server)and make another record manually.
Does SQL-Server records "was Deleted record" or another information in elsewhere?
Thanks and Regret

推荐答案

SELECT
    *
FROM
    fn_dblog(NULL, NULL) where operation ='LOP_DELETE_ROWS' and AllocUnitName like 'TableName%'





这将返回表中已删除行的日志。您可以选择所需的列



This will return the log of deleted rows on table. You can choose the column required


SELECT
    *
FROM
    fn_dblog(NULL, NULL) where operation ='LOP_MODIFY_ROW' and AllocUnitName like 'TableName%'





这将返回表的更新行



This will return the update rows for the table


这篇关于获取手动删除记录的日志的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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