Link to home
Start Free TrialLog in
Avatar of Mehram
MehramFlag for Pakistan

asked on

how to undo Wrong Update Statement

URGENT ++ URGENT

Sir, I have table IMPCDTCP
and pass wrong update command just now by mistake

the command was:-

Update IMPCDTCP
Set Rate='4.69',billno='0055'

which has been updated
(22962 row(s) affected)

Is there any way to do it reverse
Please help
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

unless you had a BEGIN TRANSACTION before that UPDATE, you have to RESTORE your database.

if your db is in full recovery mode:
* issue a tlog backup
* get your last full backup and all tlog backups since that last full backup
* restore to the point in time before your update.

if your db is in simple recovery mode:
* restore the last full backup.
Avatar of Mehram

ASKER

The last back up is three days old during the that period number of editing and new update passed.
Please guide my on full recovery mode
how to check this mode and step to check time and update
check out the database properties, recovery model.
Avatar of Mehram

ASKER

Sir, in properities I am not been able to find recovery model. Please Help how to find
run this query to see for your database:
select name, recovery_model_desc
from sys.databases

Open in new window

Avatar of Mehram

ASKER

Result:

master      SIMPLE
tempdb      SIMPLE
model      SIMPLE
msdb      SIMPLE
ReportServer$SQLExpress      SIMPLE
ReportServer$SQLExpressTempDB      SIMPLE
DLI_DB      SIMPLE
Avatar of Mehram

ASKER

my database is DLI_DB
Avatar of Mehram

ASKER

no backup mode state, I was taking backup manually after deattaching database I copy and past in different location the las copy past use on 7/4/2008
as your db is in simple recovery mode, you can only do a full restore of the last full backup.

you might try some third-party tools like lumigent logexplorer, but you might already have overwritten most of the tlog file, especially with updates like yours...
Avatar of Mehram

ASKER

could you guide me please site address.
ASKER CERTIFIED SOLUTION
Avatar of Guy Hengel [angelIII / a3]
Guy Hengel [angelIII / a3]
Flag of Luxembourg image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial