Wrox Programmer Forums
|
SQL Server 2000 General discussion of Microsoft SQL Server -- for topics that don't fit in one of the more specific SQL Server forums. version 2000 only. There's a new forum for SQL Server 2005.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the SQL Server 2000 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old January 28th, 2004, 10:00 AM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default Dangerous mistake

hi friends,

  i did a big mistake.

 in my production database, i had to update one row. normally i had to give one WHERE condition.

But i forgot WHERE condition.

One field in all rows in my table is blank now. Very dangerous maaan.

I am going mad... Please help me...

Rollback transaction is not possible, i guess, since i didnt do any begin trans in the beginning.

if any one knows anything on this, plz send me a reply very fast

Thanx in advance
revin

 
Old January 28th, 2004, 11:51 AM
Friend of Wrox
 
Join Date: Jun 2003
Posts: 347
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via MSN to Adam H-W
Default

Why don't you go back to your previous back up?
 
Old January 28th, 2004, 02:13 PM
Authorized User
 
Join Date: Jun 2003
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

Yes, you should try to recover the lost values from the last complete database backup. You can restore this backup as a _NEW_ database, and you can copy the data from the restored database to the "real" database.

Here is an example of copying the Employees.LastName data in the Northwind database:

update e
set LastName = eold.LastName
from Northwind.dbo.Employees e
    inner join NorthwindOld.dbo.Employees eold
        on e.EmployeeId = eold.EmployeeId

The second option is to do a point-in-time recovery. This is possible if your last backup doesn't contain the values you accidentally deleted. If the database uses the full recovery model (bulk-logged also?), you can restore the last complete database backup as a new database and then restore the transaction log backup until before the accidental delete. You can recover the values from here.

defiant.
 
Old January 29th, 2004, 01:34 AM
Registered User
 
Join Date: Jan 2004
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

thanks for the reply guys.. but i dont have a backup for this table.

can i revert the update someways or can i attain the previous stage of table by doing something from the Transaction log?

if so how can it be done...

 
Old February 4th, 2004, 12:06 PM
Authorized User
 
Join Date: Jun 2003
Posts: 77
Thanks: 0
Thanked 0 Times in 0 Posts
Default

You can use a tool like Lumigent Log Explorer (www.lumigent.com) to browse through the log file. I never used it.

or maybe you can try the following: create a new database and back-it up. Then restore it WITH NORECOVERY and then try to do a point-in-time restore using the transaction log backup, from the production database, to a point before the acident. the chances for this to work are slim, but maybe it will. i don't have time to test this myself.

defiant.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Did you find a mistake? nzakas BOOK: Professional JavaScript for Web Developers ISBN: 978-0-7645-7908-0 47 July 18th, 2006 05:51 PM
mistake in code yami56 Access 3 February 24th, 2005 04:04 PM
mistake in my topics zakarya_hazara Classic ASP Basics 1 October 9th, 2004 02:49 AM
A potentially dangerous Request.Form value was det bmains ASP.NET 1.0 and 1.1 Basics 1 February 17th, 2004 01:33 PM
Dangerous error occurs on topic and reply forms drfunkie BOOK: ASP.NET Website Programming Problem-Design-Solution 2 July 11th, 2003 09:00 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.