October 18, 2013 at 6:03 am
I’ve accidentally executed DROP TABLE statement tables and I lost all the data, is there a way I can retrieve my data back?
October 18, 2013 at 6:07 am
Restore a backup. I hope you have backups.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 18, 2013 at 6:13 am
There's no undo command unfortunately!
October 18, 2013 at 6:23 am
Fetch your latest backup, restore it as a new database, generate the table definition, execute it on the original database, copy the data over.
Gail Shaw
Microsoft Certified Master: SQL Server, MVP, M.Sc (Comp Sci)
SQL In The Wild: Discussions on DB performance with occasional diversions into recoverability
October 18, 2013 at 6:28 am
I don't have a backup
October 18, 2013 at 6:30 am
hoseam (10/18/2013)
I don't have a backup
Sorry to hear that.
Let this be an incentive to implement a backup plan.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 18, 2013 at 6:56 am
hoseam (10/18/2013)
I don't have a backup
Then you cannot get the table back. I hope this was not production...
MCSE SQL Server 2012\2014\2016
October 18, 2013 at 7:16 am
Alternatively, petition for the UNDROP TABLE command to be introduced in SQL Server 2016.
Hope you found a way to get the table recreated from somewhere.
October 18, 2013 at 4:11 pm
Richard Warr (10/18/2013)
Alternatively, petition for the UNDROP TABLE command to be introduced in SQL Server 2016.
UNDROP is not ISO compliant. PICKUP TABLE is what you want to lobby for.
---------------------------------------
elsasoft.org
October 19, 2013 at 11:18 am
hoseam (10/18/2013)
I don't have a backup
Is it also safe to assume that you have no snapshots? Or a copy of the database somewhere else that you can copy the data from, maybe a test environment?
October 19, 2013 at 11:20 am
Richard Warr (10/18/2013)
Alternatively, petition for the UNDROP TABLE command to be introduced in SQL Server 2016.Hope you found a way to get the table recreated from somewhere.
Personally I would like to see a $RECYCLEBIN object for SQL Server such as Oracle has. This would be extremely good in such a situation......
October 20, 2013 at 1:25 pm
kevaburg (10/19/2013)
Richard Warr (10/18/2013)
Alternatively, petition for the UNDROP TABLE command to be introduced in SQL Server 2016.Hope you found a way to get the table recreated from somewhere.
Personally I would like to see a $RECYCLEBIN object for SQL Server such as Oracle has. This would be extremely good in such a situation......
It would be a great addition in a development/testing environment, however possibly a waste of resources in a tightly managed production environment.
Need an answer? No, you need a question
My blog at https://sqlkover.com.
MCSE Business Intelligence - Microsoft Data Platform MVP
October 21, 2013 at 12:44 am
Koen Verbeeck (10/20/2013)
kevaburg (10/19/2013)
Richard Warr (10/18/2013)
Alternatively, petition for the UNDROP TABLE command to be introduced in SQL Server 2016.Hope you found a way to get the table recreated from somewhere.
Personally I would like to see a $RECYCLEBIN object for SQL Server such as Oracle has. This would be extremely good in such a situation......
It would be a great addition in a development/testing environment, however possibly a waste of resources in a tightly managed production environment.
You might have a point but only a small one I think.
The recyclebin only contains the text statement so its size remains compatively small. In contrast to SQL Server, the restoration of a table can be done online meaning no downtime.
Alternatively, a technology such as FLASHBACK TABLE TO BEFORE DROP could also be a life/job/money saver.
There a lot of lessons Microsoft could learn from Oracle in this area and I ask myself alot why it hasn't been more seriously addressed.
Viewing 13 posts - 1 through 12 (of 12 total)
You must be logged in to reply to this topic. Login to reply
This website stores cookies on your computer.
These cookies are used to improve your website experience and provide more personalized services to you, both on this website and through other media.
To find out more about the cookies we use, see our Privacy Policy