Avatar of Mehram
Mehram
Flag 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
Microsoft SQL Server 2005

Avatar of undefined
Last Comment
Guy Hengel [angelIII / a3]

8/22/2022 - Mon
Guy Hengel [angelIII / a3]

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.
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
Guy Hengel [angelIII / a3]

check out the database properties, recovery model.
This is the best money I have ever spent. I cannot not tell you how many times these folks have saved my bacon. I learn so much from the contributors.
rwheeler23
Mehram

ASKER
Sir, in properities I am not been able to find recovery model. Please Help how to find
Guy Hengel [angelIII / a3]

run this query to see for your database:
select name, recovery_model_desc
from sys.databases

Open in new window

Mehram

ASKER
Result:

master      SIMPLE
tempdb      SIMPLE
model      SIMPLE
msdb      SIMPLE
ReportServer$SQLExpress      SIMPLE
ReportServer$SQLExpressTempDB      SIMPLE
DLI_DB      SIMPLE
⚡ FREE TRIAL OFFER
Try out a week of full access for free.
Find out why thousands trust the EE community with their toughest problems.
Mehram

ASKER
my database is DLI_DB
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
Guy Hengel [angelIII / a3]

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...
Your help has saved me hundreds of hours of internet surfing.
fblack61
Mehram

ASKER
could you guide me please site address.
ASKER CERTIFIED SOLUTION
Guy Hengel [angelIII / a3]

THIS SOLUTION ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
GET A PERSONALIZED SOLUTION
Ask your own question & get feedback from real experts
Find out why thousands trust the EE community with their toughest problems.