Hi,
Can we get deleted records from database? if yes, how?
Thanks.
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Datta KharadPosted Dec 30, 2011, 12:52 AM
Did you get answer or not?
Vijay YadavPosted Dec 30, 2011, 12:55 AM
Datta KharadPosted Dec 23, 2011, 12:55 AM
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
Prabhu RajaPosted Dec 23, 2011, 12:54 AM
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.