Hi,
Can we get deleted records from database? if yes, how?
Thanks.
How to get deleted record
4 Answers
Know the answer? Post it. Somebody with the same question will find it here.
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Datta KharadRank #2,135 · 668 reputationPosted Dec 29, 2011, 7:52 PM EST
Did you get answer or not?
Prabhu RajaRank #861 · 2.6K reputationPosted Dec 22, 2011, 7:54 PM EST
1) create a new table, that will have the same structure of an existing one.
2) Create a After Trigger for delete Operation, and place the deleted row in to the new table.
3) So, you can get the deleted rows at any time from newly created table.
Datta KharadRank #2,135 · 668 reputationPosted Dec 22, 2011, 7:55 PM EST
You can get deleted record from sql server using this command..
Select [RowLog Contents 0] FROM sys.fn_dblog(NULL, NULL) WHERE AllocUnitName = 'dbo.TableName'
AND Context IN ( 'LCX_MARK_AS_GHOST', 'LCX_HEAP' ) AND Operation in ( 'LOP_DELETE_ROWS' )
Also refer this link
http://dba.stackexchange.com/questions/995/get-deleted-records
Vijay YadavRank #1,637 · 943 reputationPosted Dec 29, 2011, 7:55 PM EST