Solved

How to recover the records which were deleted accidently

Posted on 2014-02-25
3
180 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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

MIM Survival Guide for Service Desk Managers

Major incidents can send mastered service desk processes into disorder. Systems and tools produce the data needed to resolve these incidents, but your challenge is getting that information to the right people fast. Check out the Survival Guide and begin bringing order to chaos.

Question has a verified solution.

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

Suggested Solutions

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
INTRODUCTION: While tying your database objects into builds and your enterprise source control system takes a third-party product (like Visual Studio Database Edition or Red-Gate's SQL Source Control), you can achieve some protection using a sing…
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

733 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