Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Undo a query in Sql server 2005 - rollback

Posted on 2008-10-07
3
Medium Priority
?
2,416 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 1500 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

Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction This article will provide a solution for an error that might occur installing a new SQL 2005 64-bit cluster. This article will assume that you are fully prepared to complete the installation and describes the error as it occurred durin…
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Exchange organizations may use the Journaling Agent of the Transport Service to archive messages going through Exchange. However, if the Transport Service is integrated with some email content management application (such as an anti-spam), the admin…

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