Solved

How to recover the records which were deleted accidently

Posted on 2014-02-25
3
178 Views
Last Modified: 2014-04-14
I have an table gtrainers, i deleted it unknowingly. Can i recover rows back.
I used
Begin Transaction
rollback transaction

Did'nt worked.
0
Comment
Question by:searchsanjaysharma
3 Comments
 
LVL 8

Assisted Solution

by:Andrei Fomitchev
Andrei Fomitchev earned 250 total points
ID: 39888060
You should restore from backup using "point in time" just before the rows were deleted.

Usually maintenance plan has
1. FULL BACKUP daily
2. TRANSACTION LOG backup every 15 minutes.

Right click on DB
Tasks
Restore
Point in time - set Date/Time
Restore under different name (just in case if something goes wrong).
0
 
LVL 22

Accepted Solution

by:
Steve Wales earned 250 total points
ID: 39888962
fomand is correct, you can't use rollback to recover from a dropped table.

For further information, usually SQL Server Management Studio (if that's what you're using) does a commit after each and every statement by default - meaning that unless you enclose the statements you're actually running in a BEGIN TRANSACTION / COMMIT TRANSACTION - or BEGIN TRANSACTION ... execute your statements ... COMMIT or ROLLBACK depending upon results then there's nothing you can do.

However, one thing you should always be aware of - any time you issue DDL statements on database objects (CREATE, DROP etc), there is an implicit commit performed on the database after the statement is issued.

So even if you have your DROP TABLE inside a BEGIN TRANSACTION, you can't rollback a dropped table - the DROP statement implicitly commits.  DDL just isn't able to be rolled back from.

Sorry, but you need to restore from backup.
0
 

Author Closing Comment

by:searchsanjaysharma
ID: 39999616
tx
0

Featured Post

NAS Cloud Backup Strategies

This article explains backup scenarios when using network storage. We review the so-called “3-2-1 strategy” and summarize the methods you can use to send NAS data to the cloud

Question has a verified solution.

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

Suggested Solutions

So every once in a while at work I am asked to export data from one table and insert it into another on a different server.  I hate doing this.  There's so many different tables and data types.  Some column data needs quoted and some doesn't.  What …
Introduction: When running hybrid database environments, you often need to query some data from a remote db of any type, while being connected to your MS SQL Server database. Problems start when you try to combine that with some "user input" pass…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

773 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