How to recover a accidently deleted Table?

  • Hi to All,

    Anyone pls give solution to how to recover a accidently deleted table in MS-SQL.

    Thanks in advance.

  • If you have a snapshot, you can recover the table from the snapshot. Else I suggest to restore the database with another name and export the table to the original database.

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **
  • If this is SQL 2000, go download Log Rescue from Red Gate (I work for them, it's free) and it might be able to read the T-log or log backup and give you a script to undo the transaction.

    If it's 2005, ApexSQL has a tool to read that log.

  • ....or take a log backup, restore the latest full backup to a different db name with norecovery apply the log backup that was just taken to the point in time that was just prior to the table deletion using with recovery and then copy the table back to the original database. Obviously not a great solution if working with a huge database but it gives you a great opportunity to test your backups and recovery processes.

    Unfortunately this only works if you have the database in full recovery model too.

    David

    @SQLTentmaker

    “He is no fool who gives what he cannot keep to gain that which he cannot lose” - Jim Elliot

  • How big is your database..the way you say it was accidentally deleted I dont think it was either big or it was mission critical. Anyways if you use Litespeed then use the object recovery to restore the single table from the backup. If not use BCP or as some people above suggested restore to a different name and then export data.

    Thanks

    The_SQL_DBA
    MCTS

    "Quality is never an accident; it is always the result of high intention, sincere effort, intelligent direction and skillful execution; it represents the wise choice of many alternatives."

  • Thanks for reply.....

    I will work on the solutions you have given......

  • Is there any other way to recover it?

  • suhas.kanade (9/22/2008)


    Is there any other way to recover it?

    What way(s) did you try? Didn't it work? What errors did you encounter?

    ** Don't mistake the ‘stupidity of the crowd’ for the ‘wisdom of the group’! **

Viewing 8 posts - 1 through 7 (of 7 total)

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