Tuesday, March 27, 2012

Can I get it back the deleted records?

Dear All,
If I used a SQL command "Delete" to delete for example 1000 records, can I
get it back after? It is because I executed the delete command and later
found out I need some records back. Thank you for your help.
DarylThere are two options:
1=2E Do a Restore (Perhaps you have a point in time backup of the
database with transaction logs)
2=2E If you capsulated the query in a transaction (which I assume you
didn=B4t) Roll it back with ROLLBACK
HTH, Jens Suessmeyer.|||Daryl
yes, if you are lucky. you have to resort to back up. when did you take last
back up?
If you have taken any back up just prior to you can apply that. Wait I
understand that is not there. so you have to depend on 'Point in time '
Recovery.
BOL Has this: But remember. It will restore back to that particulat time. So
all the oprations after that time are be done manually again. Anyway take
full back up with no_truncate option before doing anything.
To restore to a point in time BOL has this.
Expand a server group, and then expand a server.
Expand Databases, right-click the database, point to All Tasks, and then
click Restore Database.
In Restore as database, type or select the name of the database to restore,
if different from the default.
Click Database.
In the First backup to restore list, click the backup set to restore.
In the Restore list, select the database backup and one or more transaction
logs to restore.
Click Point in time restore, and then type values for Date and Time.
Click the Options tab, and then click Leave database operational. No
additional transaction logs can be restored.
--
search and read for point-in-time;point of failure and related topics before
doing anything
--
Take Preventive measures like using
1) use delete trigger to not to rollback when
@.@.rowcount >1 or some records( if it is practical for you)
2) use trigger to store in history tables if data is so crucial.
Regards
R.D
"Daryl" wrote:

> Dear All,
> If I used a SQL command "Delete" to delete for example 1000 records, can I
> get it back after? It is because I executed the delete command and later
> found out I need some records back. Thank you for your help.
>
> Daryl
>
>

No comments:

Post a Comment