How to recover a deleted row from SQL Server 2005 table?
5 Answers
If you have database backups that have deleted data:
- Restore backup in separate database and recover deleted data from there
If there are no backups but your database is in full recovery mode:
- Try reading transaction log using some third party transaction log reader or using DBCC LOG command.
You’ll need help from third party tools because transaction log is not well documented. This is because it’s purpose is not to be used for this kind of recovery. However, if you can read it there are a lot of useful details there that can be used to recover accidentally deleted data.
Comments
The ApexSQL Log tool can be the solution for deleted rows. In case the DELETE operation exists (the database was not using the Simple recovery model) in database transaction logs (online, backups), the tool can create an undo T-SQL script for the operation.
Disclaimer: I work as a Product Support Engineer at ApexSQL