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 (20)

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.

rousseau
Vote Up (15)

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

Christopher Nerney
Vote Up (15)

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.

 


 


 


Enrique Mallon
Vote Up (5)

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.
The Internet puts the goods, services and expertise you need at your fingertips. Some call it a 'collaborative economy' focused less on transactions and more on trades. Others see a throwback to the early days of economic exchange. Either way, it's quickly changing the way we do business.
Most unaware of, uninterested in, or hostile to mobile tracking, paying.
I've long called for HBO to make its content available to stream for people with no cable subscription. Finally we're making some progress!
Small businesses increasingly turn to Square to process payments without the hassle (and expense) of custom card-reading hardware. There are other benefits to the service, including analytics and online sales modules, as well as opportunities for larger enterprises to better serve customers.
Net income is up, yet the company says it needs to raise subscription fees.
In today's accessible technology roundup: Google wants to embed cameras in contact lenses, Apple gets a patent for a new GUI for touch devices to improve accessibility and a hacker develops a virtual cane for the blind
Streaming your games for others to watch on Twitch is a big fad these days, but it looks like the company is taking the first tentative steps towards branching into other areas.
According to a new dataset, the big names in technology lag well behind actors, politicians and athletes in terms of global cultural significance
Numbers show that paid peering arrangements result in measurable increases in service quality.
The space agency has published a catalog of its software being made available to the public, and it includes code for things other than flying a rocket to the moon
randomness