Solved

Undo a query in Sql server 2005 - rollback

Posted on 2008-10-07
3
2,390 Views
Last Modified: 2012-05-05
Hello,
i executed the following query :
UPDATE dbo.SrDDW
SET
BPmaterial = 'NA'
FROM         dbo.SrDDW
WHERE (ProductType <> N'body')

and it was a big mistakes in the filter of the where clause!!!!

is there any method i can undo the change in the SrDDW table
0
Comment
Question by:Nyana22
  • 2
3 Comments
 
LVL 142

Expert Comment

by:Guy Hengel [angelIII / a3]
Comment Utility
if you had a BEGIN TRANSACTION before the update:
ROLLBACK

otherwise, you will have to RESTORE the database with a FULL backup of before that, and in case your db is in full recovery mode, you have to do a t-log backup (before the restore, of course), and you can restore to the point in time before that errror.
0
 

Author Comment

by:Nyana22
Comment Utility
Hi angelll,
i didnt have a begin transaction.

now the data is modified in the table
if i make a backup, and after i will make a restore, the data will be the one just befire this query???
please

thanks
0
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
Comment Utility
as I said, you will need a full backup BEFORE the problem...

you might want to check out to stop any activity on the db, and try out third-party tools to read the t-log, to get the updates to undo the work: lumigent logexplorer is one of those tools.
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

If you having speed problem in loading SQL Server Management Studio, try to uncheck these options in your internet browser (IE -> Internet Options / Advanced / Security):    . Check for publisher's certificate revocation    . Check for server ce…
There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

772 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now