4

Possible Duplicate:
How do I get back some deleted records?

Our C#.NET application mistakenly deleted all records from all tables of its database. The application automatically takes backups, and the last backup it took after this delete is big in size, which means there must be useful data in the backup. The recovery model of the database is SIMPLE and I turned the server off after the records were deleted.

How can I recover the deleted records?

Hamid
  • 225
  • 2
  • 4
  • 7

2 Answers2

1

It sounds like, with your scenario, the easiest way would be to grab a backup of the database and restore it side-by-side your current database. You need to ensure that this backup contains the deleted records. Then simply do an INSERT INTO ... SELECT FROM ... to get the deleted records from the old database (via a backup/restored version) into your current.

If you don't have a backup of the database containing all of the data, you may be out of luck here.

Thomas Stringer
  • 42,434
  • 9
  • 120
  • 155
0

Here are few suggestions:

  • If you have transaction started then you can rollback the transaction which will get teh deleted records back.
  • If you have the full backup of the DB then restore the DB and all your data will be in place.
  • If you have taken a snapshot fo the DB then you can restore from that snapshot as well like

    USE master;
    RESTORE DATABASE DBNAME FROM DATABASE_SNAPSHOT = 'SNAPSHOT NAME'; GO

  • Else, if you have transaction log enabled then you can restore from transaction log as all deletes gets logged.

Check this link on how to do the same

http://raresql.com/2011/10/22/how-to-recover-deleted-data-from-sql-sever/

Rahul
  • 143
  • 2