Solved

Undo a query in Sql server 2005 - rollback

Posted on 2008-10-07
3
2,397 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]
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 142

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

The Eight Noble Truths of Backup and Recovery

How can IT departments tackle the challenges of a Big Data world? This white paper provides a roadmap to success and helps companies ensure that all their data is safe and secure, no matter if it resides on-premise with physical or virtual machines or in the cloud.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Sql query 12 72
Parsing the XML data to SQL Server 4 65
Table create permissions on SQL Server 2005 9 41
Query to return total 6 17
When writing XML code a very difficult part is when we like to remove all the elements or attributes from the XML that have no data. I would like to share a set of recursive MSSQL stored procedures that I have made to remove those elements from …
In SQL Server, when rows are selected from a table, does it retrieve data in the order in which it is inserted?  Many believe this is the case. Let us try to examine for ourselves with an example. To get started, use the following script, wh…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, just open a new email message. In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

816 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

11 Experts available now in Live!

Get 1:1 Help Now