Tuesday 7 August 2012

 ----SQL Server keeps logs for each deleted record. You can query these logs via the fn_dblog SQL Server function.

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' )  
;

No comments:

Post a Comment