Is it possible to recover a table that has been deleted?

  • I deleted a table in a SQL Server 2008 database via right clicking it and selecting "Delete" in Management Studio and afterwards realized I shouldn't have. Is there any way of undoing this other than restoring the backup?

  • Do you have a Mirror, Replicated table, or Database snapshot? If so, you could retrieve it from there. If not, then your only choice would be to restore the database somewhere else and then copy the table over using SSIS or direct querying.

    Sorry I can't give you a better answer. Been there, done that.

  • Luckily I have the data in a flat file. I'll just recreate it. Just thought it would be nice if there were sort of like a "Recycle Bin"

  • That's why backups are important (one of the reasons)

    If you drop a table within a transaction, the drop can be rolled back, just like any other change. Once the transaction has been committed, there's no undo.

    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

    We walk in the dark places no others will enter
    We stand on the bridge and no one may pass
  • To second GilaMonster's comment...we cannot exempt ourselves as DBAs from the rules we apply to Developers...ALWAYS have a rollbadk plan...NEVER make changes without protection.

  • If you are not sure, always create a copy of the table or the object first. Always easier to rename that to recreate.

    Andrew SQLDBA

Viewing 6 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic. Login to reply