Print Page | Close Window

Rollback changes done to a query in SQl s

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: Database Discussion
Forum Description: Discussion and chat on database related topics.
URL: https://forums.webwiz.net/forum_posts.asp?TID=7936
Printed Date: 30 March 2026 at 12:17pm
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Rollback changes done to a query in SQl s
Posted By: ravi_zee
Subject: Rollback changes done to a query in SQl s
Date 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.



Replies:
Posted By: pmormr
Date Posted: 08 December 2003 at 2:20pm

hopefully you have a backup... if you don't your screwed



-------------
Paul A Morgan

http://www.pmorganphoto.com/" rel="nofollow - http://www.pmorganphoto.com/


Posted By: fernan82
Date 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
http://www.danasoft.com/">


Posted By: michael
Date 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.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: fernan82
Date Posted: 09 December 2003 at 6:29pm
how you do a point in time restore?

-------------
FeRnAN
http://www.danasoft.com/">


Posted By: michael
Date 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'



-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker


Posted By: fernan82
Date 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
http://www.danasoft.com/">


Posted By: michael
Date 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.

-------------
http://baumannphoto.com" rel="nofollow - Blog | http://mpgtracker.com" rel="nofollow - MPG Tracker



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net