views:

55

answers:

4

I updated a table in my SQL Server 2008 by accident, I was updating a table from another by copying cell by cell, but I have overwritten the original table. Is there a way that I can restore my table contents as it was?

+4  A: 

No. If you commited the transaction, the only way to restore the original table is by getting it from your latest backup.

Pablo Santa Cruz
@Pablo Santa Cruz: I heard that there is something in the SQL Server I guess it is called transaction log, which contains all the transactions I made, but I`m not sure about it!!
sikas
@sikas - Do you know what recovery model your database is in?
Martin Smith
@Pablo Santa Cruz: nope I don`t know, how can I know that?
sikas
@sikas - It wasn't pablo that made the comment! You can find out by following one of the approaches here http://blogs.lessthandot.com/index.php/DataMgmt/DataDesign/find-out-the-recovery-model-for-your-dat (though I think you would still be looking at third party tools to read the log unless you have ever taken a database backup)
Martin Smith
+1  A: 

if you have only a backup then restore that to another database and move just the table over (this way no other tables will be affected). If you have also transaction log backups then you can also do a point in time restore

SQLMenace
@SQLMenace: HOw can I find those transaction log backups?
sikas
ask your DBA or however has setup this database and the backup strategy
SQLMenace
@SQLMenace: well, I`m the one who installed the SQL Server, I installed it on my personal PC not a company one, yet I don`t know where to find or where are those logs stored!
sikas
did you ever create a backup/maintenance plan? If not you won't have transaction log backups
SQLMenace
+1  A: 

I've heard that there are some tools that might be able to undo certain actions in certain circumstances. Here's a link to an interesting article about how to minimize data loss in these circumstances and it includes links to some tools.

You might want to ask this question at ServerFault as well as some sysadmins might know better.

ho1
+1  A: 

This tool says it can do it, a bit pricey though. There is a trial period, maybe that will be long enough to get your data back:

http://www.apexsql.com/sql_tools_log.asp?_kk=log%20explorer&_kt=49fb8026-ca7c-4c5e-bb06-99ee95393472&gclid=CPWP48T3i6ICFY1a2godtTS7UQ

Ron Savage