undo a delete statement...is it possible

  • I've made a very silly mistake. I was supposed to run this statement

    delete table_columns

    where col_id = 1223

    but instead I mistakenly executed just the 1st line.

    I have no backups....is there any possible way to undo this

    thanks....

  • I'm assuming you did not do this within a transaction either.  Once you've deleted it, it's gone.  You can purchase 3rd party software for viewing transaction logs, but I'm not sure if they have the capability to assist in recovering data.  I had used Lumigent's Log Explorer for a trail period, but I don't remember if it is capable of recovery.  You would at least be able to see what was deleted and use that to manually recover.  I would recommend stoping everything you are doing and take a backup first!!

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • assuming you're in full recovery you can use one of the many log reading tools to recover the data. Redgate have one. likewise Lumigent. Be aware that very few of these tools allow the  eval to actually recover a user database data, you'll likely need to buy one.

    [font="Comic Sans MS"]The GrumpyOldDBA[/font]
    www.grumpyolddba.co.uk
    http://sqlblogcasts.com/blogs/grumpyolddba/

  • I have some backups in the filegroups or files section (mdf's)  dated from yesterday could I use them to restore?

  • Ah, you do have a backup.  You cannot selectively restore data so you'll need to restore the backup to a new database and copy the missing data over from there. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • great.

     thanks

  • is it possible to use the .mdf in any way for a restore?

  • Do you have a SQL Backup or a MDF file?  If you have a MDF file with yesterdays date, where did it come from?  If you truely have a MDF file, attach it to your SQL Server instance and copy the missing data from it. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

  • how do  I do that

  • Go into EM, right-click on Databases, go to All Tasks>>Attach Database.  You will then be able to browse out and find the MDF file.  Use the Attach as box to name the DB. 

    John Rowan

    ======================================================
    ======================================================
    Forum Etiquette: How to post data/code on a forum to get the best help[/url] - by Jeff Moden

Viewing 10 posts - 1 through 9 (of 9 total)

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