Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 655457
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T22:36:21+00:00 2026-05-13T22:36:21+00:00

Long story short is I tried to quickly update a single row in SQL

  • 0

Long story short is I tried to quickly update a single row in SQL Server using the Management studio and just typed UPDATE table SET column='value' and forgot the WHERE other_column='other_value' portion. Went for lunch, came back and theres 15 unread emails waiting for me. Happened about an hour ago, waiting for the database guy to come back to see when the last backup was. There’s no magic UNDO feature though is there?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-13T22:36:21+00:00Added an answer on May 13, 2026 at 10:36 pm

    Yes, there is – it’s the transaction log. To recover from something like this, as long as you have your database in FULL recovery model, you’d just do another transaction log backup, and then do a restore with the STOPAT option set to tell the restore to stop restoring at the point in time right before you started your transaction. This will revert the database back to the point of your mistake.

    See here for more info on using the STOPAT option – http://msdn.microsoft.com/en-us/library/ms186858(SQL.90).aspx.

    Your script would look something like this…

    -- backup the existing log
    BACKUP LOG [MyDatabase]
         TO DISK = N'\\MyServer\Share\MyDatabase.trn'
         -- options left out for brevity
    GO
    
    -- restore the database first
    RESTORE DATABASE [MyDatabase] 
        FROM  DISK = N'\\MyServer\Share\MyDatabase.bak' 
        WITH  FILE = 1,  
        NORECOVERY,  
        NOUNLOAD,  
        STATS = 10
    GO
    
    /* Previous transaction logs in the chain go here... */
    
    /* restore your log that you backed up after the mistake 
       took place, stopping at your point where the problem happened */
    RESTORE LOG [MyDatabase] 
        FROM  DISK = N'\\MyServer\Share\MyDatabase.trn' 
        WITH  FILE = 1,  
        NORECOVERY,  
        NOUNLOAD,  
        STATS = 10,
        STOPAT = '2010-03-12 13:00'
    GO
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Long story short, we found files promoting prescription drugs on our server that we
Long story short, the database I'm using needs to get looked at. Until that
Long story short, client's hosting is using php 5.2.5 and i desperately need to
Okay so to make a long story short I am using this script in
Long story short, I'm using DES and I'm encrypting a password using RSA for
I am trying to teach myself AI using neural networks. Long story short, I
Long story short, I have a substantial Python application that, among other things, does
Long story short, I have an ASP.NET application I'm trying to debug and at
Long story short, I'm developing a theme template for a blog that enables you
Long story short, I'm making a custom Swing component that's basically a JTable with

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.