| Author |
Topic Search Topic Options
|
ravi_zee
Newbie
Joined: 05 December 2003
Status: Offline
Points: 3
|
Post Options
Thanks(0)
Quote Reply
Topic: Rollback changes done to a query in SQl s Posted: 08 December 2003 at 4:27am |
|
Hi, I have updated awrong table in SQLSERVER 6.5.... But I want to rollback the changes done to the table as I have updated a wrong table Will anyone let me know the process....
very very urgent.
|
 |
pmormr
Senior Member
Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 December 2003 at 2:20pm |
hopefully you have a backup... if you don't your screwed
|
|
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 08 December 2003 at 10:19pm |
Yep, you're screwed if you don't have a backup. That reminds me
when I forgot the main admin password on one of my forums and I ran
this query to reset it as I didn't had an email address on the main
admin account:
UPDATE tblAuthor SET Password = 'MyNewPassHash', Salt='MyNewSalt' WHERE Author_ID = 1
But
it was like 3am and I was half asleep so I forgot the part in red!!
When it took like 10 seconds to process I was like oh sh*t! Then I see
the 4000 row(s) affected. 
I did
had a backup but it was from the morning the same day and I would loose
a lot of posts if I restore it, so I had to write a script real quick
to reset all the passwords again and email each user a new password.
|
FeRnAN
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2003 at 4:21pm |
|
You are not screwed, that is what a transaction log is good for. Do a Point in time restore.
|
|
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2003 at 6:29pm |
|
how you do a point in time restore?
|
FeRnAN
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 09 December 2003 at 8:54pm |
In a Nutshell, you just make a backup of your db,log and use syntax like RESTORE LOG wwfforum FROM wwfbu --The Backup device WITH NORECOVERY, STOPAT = '2003-12-08 19:57:49.723'
|
|
|
 |
fernan82
Mod Builder Group
Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
|
Post Options
Thanks(0)
Quote Reply
Posted: 10 December 2003 at 10:51pm |
Thanks, I'll make sure I remember that.
So there's really no need to make routine backups if can always restore to any point in time like that, is there.?
|
FeRnAN
|
 |
michael
Senior Member
Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
|
Post Options
Thanks(0)
Quote Reply
Posted: 13 December 2003 at 8:44am |
|
There sure is a need, as your transaction log might get smashed. You should backup your TL more often then your actual database if it is an update happy database.
|
|
|
 |