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

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

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

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

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.

[chunklet]

Cartoon showing SpaceX's Dragon capsule. Two astronauts are suited up looking at it. One says 'Dang! I knew a space taxi was a bad idea.' On top of the capsule is a sign like those on real taxis with 'Off Duty' lit up.

Well, it sounded like a good idea

Image credit: ITworld/Phil Johnson

[/chunklet]

Big news from NASA this week, when it awarded contracts totaling almost $7 billion to Boeing and SpaceX to

[chunklet]

Picture of a man passing a sign for a coffee shop in London

Tech workers aren't turning to coffee as much as some other occupations

Image credit: REUTERS/Luke MacGregor

[/chunklet]

Last week

[chunklet]

Picture of a youth soccer team huddled up closely.

An open source project with a close project team is more likely to succeed

Image credit: flickr/popofatticus (license)

[/chunklet]

This week, Facebook, Google and a number of other big companies

Google's decision last year to kill Google  

Source: Mojang

Yesterday we got the official word that Microsoft is buying

Microsoft has agreed to buy Mojang, the Swedish developer of the Minecraft PC and console game, for $2.5 billion, the companies  

[chunklet]

Cartoon showing Apple CEO Tim Cook on stage. Behind him is a screen with the words, 'One more thing...' He's holding up a pair of pants with oversized front pockets with the Apple logo on them. He says, '.. if you want to carry your new iPhone 6 Plus phone in your pocket, you'll need a pair of our new Apple Pants!'

How did Apple not think of this?

Image credit: ITworld/Phil Johnson

[/chunklet]

As you know, Apple finally

Source: Xbox.com

It feels like September has hardly gotten started and  

[chunklet]

Picture of milk being poured into a cup of coffee

Good coffee makes for happy workers

Image credit: flickr/Market Lane Coffee (license)

[/chunklet]

Hiring software engineers is no easy task these days, as the

Join us:
Facebook

Twitter

Pinterest

Tumblr

LinkedIn

Google+