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?

5
  • 1
    Do the answers in the linked question? It does look like the exact same situation to me - check Brent Ozar's answer in particular for the situation in simple recovery mode. Commented May 14, 2012 at 7:27
  • @JackDouglas It dose not help me, My recovery mode was simple instead of full, and I want to find new records which has deleted.
    – Hamid
    Commented May 14, 2012 at 17:24
  • You mean new records since the last backup? Commented May 14, 2012 at 21:20
  • @JackDouglas , yes new records since the last backup, because user insert more than 2000 records in one day without any backup and press wrong keys together which that delete all records in one second from all tables.
    – Hamid
    Commented May 15, 2012 at 4:06
  • In which case your only hope is the transaction log and being in simple recovery mode makes it a long shot. This is an exact duplicate and I'm closing it as such - I'm sorry we've not been able to give you better news. Commented May 15, 2012 at 5:55

2 Answers 2

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.

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/

1
  • I was read that link, but my database recovery mode is simple (not full) . but when I execute select from sys.fn_dblog it return more records which assigned to deleted rows!
    – Hamid
    Commented May 14, 2012 at 5:23

Not the answer you're looking for? Browse other questions tagged or ask your own question.