Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 SQL Server 2000 Forums
 SQL Server Administration (2000)
 Recovery of Data

Author  Topic 

AskSQLTeam
Ask SQLTeam Question

0 Posts

Posted - 2003-10-31 : 07:49:54
rajiv writes "Dear Sir,

By mistake i have deleted records of the table using truncate command, Plz can you help me to recover this data."

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-10-31 : 11:43:49
If you use TRUNCATE TABLE, then the data can not be recovered because that command is not logged. You will need to restore the database from the last full backup. You should restore it with a different name. Then copy the data from this new database into your database.

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-02 : 09:42:48
quote:
If you use TRUNCATE TABLE, then the data can not be recovered because that command is not logged
It is logged, it's just not logged the same way a DELETE operation is. You'll still need to restore from a backup.
Go to Top of Page

mohdowais
Sheikh of Yak Knowledge

1456 Posts

Posted - 2003-11-02 : 12:15:29
Boy, is this guy in trouble!

Owais


Where there's a will, I want to be in it.
Go to Top of Page

Merkin
Funky Drop Bear Fearing SQL Dude!

4970 Posts

Posted - 2003-11-03 : 01:14:09
SELECT * FROM [Recycle Bin]

How is that hair splitting working for ya Rob....



Damian
Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2003-11-04 : 12:02:22
Thanks Rob. What is logged about TRUNCATE then?

Tara
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2003-11-04 : 13:04:04
Page deallocations are logged, instead of logging each deleted row.
Go to Top of Page

jasper_smith
SQL Server MVP & SQLTeam MVY

846 Posts

Posted - 2003-11-04 : 13:54:31
As already indicated, it's tricky However, if you immediately cease all activity in the database, you can use Log Explorer from lumigent [url]http://www.lumigent.com/Products/le_sql/le_sql.htm[/url] to recover your data. Log Explorer will generate the insert statements for you to rebuild your table. This even works in simple recovery model (assuming the log has not been truncated) - even if it can't get all of it, you might be able to recover something. I am assuming you have no backups ?

Go to Top of Page
   

- Advertisement -