How can I recover a table that I dropped in SQL?

owen

I accidentally deleted a table when I meant to delete a column. It was just a moment when I was thinking about other things and entered in DROP TABLE XXXX. when I meant to enter ALTER TABLE XXXX. Is there any way to recover the table? I can dig into the backups, so it's not the end of the world, but that's not how I hoped to spend my Friday morning.

Tags: SQL, table
Topic: Business
Answer this Question

Answers

4 total
jimlynch
Vote Up (25)

I think Christopher covered it well. It's crucial to have backups ready in case something like this happens. If you don't have them, you could be stuck with no options.

Christopher Nerney
Vote Up (19)

According to many commenters at Ask SQL Server Central, if you don't have a back-up, you're going to be out of luck.

 

However, one person writes, "There is an outside chance of getting the data if your O/S backup had an open file agent. Ask your backup team if they can restore from prior to the issue to a test environment and you may be able to get the data."

 

It's pretty much the same conclusion here: Forget about it, unless..."If the DROP TABLE was executed from within a transaction and that transaction has not yet been committed, you can roll it back."

 

Beyond that, some people suggest purchase or downloading a free trial version of a third-party product that is able to read the log file and reconstuct the table from that information.

 


 


 


rousseau
Vote Up (18)

Christopher pretty much covers it. It's amazingly how a momentary slip-up can cause a major head ache. Good luck!

Enrique Mallon
Vote Up (10)

To recover deleted tables safely you must use sql database recovery tool which is best solution for corrupt sql database. visit :- http://www.sqlrepairtool.org

Ask a question

Join Now or Sign In to ask a question.
They don't speaking the same language, bicker about the tech budget and argue over who should take ownership of mobile apps.
Linux’s creator goes on another epic rant
As a result of the confluence of disruptors such as cloud technology, mobile, social media, and big data and analytics, organizations today are rethinking their IT infrastructure from the ground up -- and it's not just IT architects and data center leaders involved.
$5/month or $30/month gets you discounts on new titles as well as access to a sub-set of EA's Xbox One back catalog.
In response to a query from Vint Cerf, professional developers explain why they don’t feel a membership in the Association for Computing Machinery is worth the cost
The venerable GNU compiler wins the ACM’s Programming Languages Software Award while simultaneously coming under fire from the Linux creator
The company and the buyer, Globalfoundaries, are too far apart on price, but the deal is not dead yet.
In happier news, next week your PS4 will be able to play 3D Blu-rays, and why that matters.
Be sure to show your sysadmin how much you appreciate him or her today - but keep it sane
Customer experience experts share their tips on how businesses can keep customers happy and coming back for more.
Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+