且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何保留数据库中已删除记录的记录

更新时间:2023-12-04 21:41:10

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