Solved

recovering delete rows in SQL 2005

Posted on 2007-11-30
7
4,789 Views
Last Modified: 2012-08-13
Is there a way to recover deleted rows in SQL 2005 with myTransaction Log?
0
Comment
Question by:mattphung
  • 3
  • 3
7 Comments
 
LVL 21

Expert Comment

by:mastoo
ID: 20384896
Recover the db and log backups into another database and then insert the records back into the original database.
0
 

Author Comment

by:mattphung
ID: 20384930
where do I get the db and log backups?
I created another db called "tempDB". How do I insert the deleted records back into the original database? Where is the deleted records kept?
0
 
LVL 21

Expert Comment

by:mastoo
ID: 20385018
Sorry, my answer only works if someone is running backups of the database.  You have a dba to ask?  If not you're probably out of luck but right-click the database in Enterprise Manager and do properties then options.  What is the Recovery Model?
0
PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

 

Author Comment

by:mattphung
ID: 20385242
My recovery model is FULL
0
 
LVL 21

Accepted Solution

by:
mastoo earned 500 total points
ID: 20385399
Ah, you might be in luck then.  Right click the "databases" node in the Enterprise Manager treeview.  Select All Tasks and then Restore.  Type in some dummy name for the Restore As, such as MyNewDb.  Go to Show backups of and select the original.  Down below hopefully you'll see a list of backups starting with a full backup and then one or more transaction log backups.  Check the last one in the list - it needs to have a date and time later than when the records were deleted.  (Stop following these steps if at any point something isn't as described)  Ok - to restore the backups into the new database name.  Then let's say you're looking for deleted records in TableOne where SomeDate = '11/29/2007'  Run a select in Query Analyzer in the restored database to look at the records and then you can do an insert into the other database to put them back.  BUT, this gets pretty ugly if there is any hierarchy of records deleted (i.e., there is a parent-child relationship and both parent and child got deleted).
0
 

Author Closing Comment

by:mattphung
ID: 31412005
Thanks for all your help! It worked.
0
 
LVL 9

Expert Comment

by:mimran18
ID: 37176116
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction SQL Server Integration Services can read XML files, that’s known by every BI developer.  (If you didn’t, don’t worry, I’m aiming this article at newcomers as well.) But how far can you go?  When does the XML Source component become …
In this article I will describe the Copy Database Wizard method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how to use the INSERT statement to insert data into their tables. It will also introduce the NULL statement, to show them what happens when no value is giving for any given column.

895 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now