RollBack Command

  • Dear Friends

    I deleted one table ,now i want to rollback.

    Can u tel me the command how to rollback this table

    ----------------------------------------------------------------------------------------------------
    Mistakes are common.....and i am not an exception....
    catch me if i am wrong....

    MAK.................!

  • Depends. If you explicitly started a transaction before runningthe command, you can just run ROLLBACK. My guess however is that you didn't start a transaction. In that case there's no simple way of getting the table back.

    If you are running in full recovery mode, you can try one of the 3rd party log recovery tools. They read the transaction log and can (sometimes) undo what you've done.

    If you have a backup and transaction log backups up to the time of the delete, you could restore and stop just before the delete.

    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
  • Dear GilaMonster

    Can u tel me how to do the transaction ,before we delete the transcation.and tel me what is the 3 rd party tool.

    Tel me the Steps.

    ----------------------------------------------------------------------------------------------------
    Mistakes are common.....and i am not an exception....
    catch me if i am wrong....

    MAK.................!

  • If you've already deleted the table, the transaction's useless as your delete has already committed. For next time, look up BEGIN TRANSACTION in books online.

    As for the 3rd party tools, there are a few. I know of (but haven't used) Apex's ApexSQL Log and Redgate's SQL Log Rescue. There are others.

    They are not free tools.

    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
  • Just to expand a little on Gail's response. RedGate's tool helped tremendously with an issue I was having. SQL log rescue IS now a free download, only for SQL2000. It appears they are discontinuing the product for newer versions of SQL as you can no longer purchase support. There's also a link on this page to allow you to compare Lumigent's product as well (probably not free!).

    http://www.red-gate.com/products/SQL_Log_Rescue/index.htm

    -- You can't be late until you show up.

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

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