Web Wiz - Green Windows Web Hosting

  New Posts New Posts RSS Feed - Rollback changes done to a query in SQl s
  FAQ FAQ  Forum Search   Events   Register Register  Login Login

Rollback changes done to a query in SQl s

 Post Reply Post Reply
Author
ravi_zee View Drop Down
Newbie
Newbie


Joined: 05 December 2003
Status: Offline
Points: 3
Post Options Post Options   Thanks (0) Thanks(0)   Quote ravi_zee Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
pmormr View Drop Down
Senior Member
Senior Member


Joined: 06 January 2003
Location: United States
Status: Offline
Points: 1479
Post Options Post Options   Thanks (0) Thanks(0)   Quote pmormr Quote  Post ReplyReply Direct Link To This Post Posted: 08 December 2003 at 2:20pm

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

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post Posted: 09 December 2003 at 6:29pm
how you do a point in time restore?
FeRnAN
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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'

Back to Top
fernan82 View Drop Down
Mod Builder Group
Mod Builder Group
Avatar

Joined: 17 November 2002
Location: United States
Status: Offline
Points: 362
Post Options Post Options   Thanks (0) Thanks(0)   Quote fernan82 Quote  Post ReplyReply Direct Link To This Post 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
Back to Top
michael View Drop Down
Senior Member
Senior Member
Avatar

Joined: 08 April 2002
Location: United States
Status: Offline
Points: 4670
Post Options Post Options   Thanks (0) Thanks(0)   Quote michael Quote  Post ReplyReply Direct Link To This Post 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.
Back to Top
 Post Reply Post Reply

Forum Jump Forum Permissions View Drop Down

Forum Software by Web Wiz Forums® version 12.08
Copyright ©2001-2026 Web Wiz Ltd.


Become a Fan on Facebook Follow us on X Connect with us on LinkedIn Web Wiz Blogs
About Web Wiz | Contact Web Wiz | Terms & Conditions | Cookies | Privacy Notice

Web Wiz is the trading name of Web Wiz Ltd. Company registration No. 05977755. Registered in England and Wales.
Registered office: Web Wiz Ltd, Unit 18, The Glenmore Centre, Fancy Road, Poole, Dorset, BH12 4FB, UK.

Prices exclude VAT at 20% unless otherwise stated. VAT No. GB988999105 - $, € prices shown as a guideline only.

Copyright ©2001-2026 Web Wiz Ltd. All rights reserved.