Solved

Undo a query in Sql server 2005 - rollback

Posted on 2008-10-07
3
2,404 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 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 22663091
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
ID: 22663115
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 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 22663186
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

Use Case: Protecting a Hybrid Cloud Infrastructure

Microsoft Azure is rapidly becoming the norm in dynamic IT environments. This document describes the challenges that organizations face when protecting data in a hybrid cloud IT environment and presents a use case to demonstrate how Acronis Backup protects all data.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

by Mark Wills Attending one of Rob Farley's seminars the other day, I heard the phrase "The Accidental DBA" and fell in love with it. It got me thinking about the plight of the newcomer to SQL Server...  So if you are the accidental DBA, or, simp…
I am showing a way to read/import the excel data in table using SQL server 2005... Suppose there is an Excel file "Book1" at location "C:\temp" with column "First Name" and "Last Name". Now to import this Excel data into the table, we will use…
This video shows how to quickly and easily add an email signature for all users on Exchange 2016. The resulting signature is applied on a server level by Exchange Online. The email signature template has been downloaded from: www.mail-signatures…
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…

830 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