Link to home
Start Free TrialLog in
Avatar of Easwaran Paramasivam
Easwaran ParamasivamFlag for India

asked on

How to retrieve deleted table?

I delete table1 from database db1 using DELETE command.

It is said that delete command is logged. I would like to bring back the deleted table.

How to achieve that? Please do explain with example/sample.
Avatar of momi_sabag
momi_sabag
Flag of United States of America image

unless you have a backup of the database from before the backup, you won't be able to restore the data

the only way to do it is to buy a tool that can parse the log files (redgate has one) and try to generate the reverse statements for the delete you executed
Avatar of Easwaran Paramasivam

ASKER

Ok. Assume I've backup.

In this case whether restore the entire database is the only option to bring back the table or some other option exists? If so, please do explain in detail.
Avatar of Jared_S
Jared_S

1) Restore your database under a new name.

2) Move the table from your old database to your new database.
(You can do this easily by running a query similar to "select * into OldDatabase.dbo.OldtableName from NewRestoredDatabase.dbo.RestoredTableName")

3) delete your restored database
@Jared_S Thanks for your comments.

I know above process by restoring the database.

As restore and delete old database is common one. Is there any other alternate option such as reading the log file and restore only the deleted table?

Please do not suggest commercial tool.

Please do provide your comments.
Was your database recovery mode set to full?
ASKER CERTIFIED SOLUTION
Avatar of Jared_S
Jared_S

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thanks.