如何保留数据库中已删除记录的记录 [英] how to keep a record of deleted records in database

查看:114
本文介绍了如何保留数据库中已删除记录的记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

专家您好,

感谢您的关注.

有人可以指导我如何跟踪已删除的记录吗?
在sqlserver数据库表中,以及删除的日期时间和其他信息.


在此先感谢您的帮助.

Hi expert,

Thanks for your attention.

Can anybody guide me on how to keep a track of deleted records
in a sqlserver database table along with deleted datetime and other info.


Thanks in advance for helping.

推荐答案

Hello Kaushik,

您是否有时间阅读文章

希望对您有帮助.也感谢您提出这个问题.我会在有时间的时候来解决这个问题.
Hello Kaushik,

Have you time to go through this article

Hope it will help you. Also thank you for this question. I''ll go through that when get time.


Kaushik,
您可以创建历史表,该历史表是原始表的影印本,但没有约束
并插入到历史表中,然后将该行删除为

Hi Kaushik,
You can Create History Table that is photicopy of Orginal table But have no constraint
and insert into historical table befor delete this row as

insert into Hst_TBL1
    SELECT    *    FROM        TBL1
    where       TBL1_Id = @Id



然后删除您想要的记录



then delete record you want

delete from TBL1 where TBL1_Id = @Id


这篇关于如何保留数据库中已删除记录的记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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