|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Hello,
I've just updated 200 rows of a table when I meant to update 1 - aaarrrgh! I want to know if there is a way to "undo" the last change to the database? It's a development database, so there will be no further changes since the last one. I have a file backup (not a SQL backup) of both the data and log files from earlier today, but a lot of work has been done since then, so if therre is a way to rollback the last update please let me know. I've tried reading lots of info on how to do this but I'm getting bogged down in all the stuff they're saying and it'd be helpful for someone to cut to chase for me. Thanks Iain |
|
#2
|
||||
|
||||
|
The best way I can think of to undo this change is a point-in-time recovery using your last full backup and your transaction log backups. This only works if you are operating in "Full" recovery mode for the database, however, not "Simple" mode. Although you could run a restore of just your most recent full backup in the latter instance.
From Books Online: RESTORE DATABASE MyNwind FROM MyNwind_1, MyNwind_2 WITH NORECOVERY GO RESTORE LOG MyNwind FROM MyNwind_log1 WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM' GO RESTORE LOG MyNwind FROM MyNwind_log2 WITH RECOVERY, STOPAT = 'Jul 1, 1998 10:00 AM' GO |
|
#3
|
|||
|
|||
|
Thanks, but it was only a file backup. I hadn't dettached the databases, or made a proper backup. I will from now on - that'll teach me!
|
![]() |
| Viewing: ASP Free Forums > Database > Microsoft SQL Server > undo the last UPDATE |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|