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
 General SQL Server Forums
 New to SQL Server Programming
 Accidental rows delete !! pls help.. 911

Author  Topic 

Pasi
Posting Yak Master

166 Posts

Posted - 2014-05-07 : 17:46:22
HI

I accidently deleted all rows within a table called "user_pref", any way to get it back? appreciate any help?
delete from user_pref

Thanks!!!

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-07 : 17:53:04
Do you have backups?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Pasi
Posting Yak Master

166 Posts

Posted - 2014-05-07 : 17:54:02
Not that I know of? any other ways?


quote:
Originally posted by tkizer

Do you have backups?

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-07 : 17:59:13
What recovery model is the database set to? And what version of SQL Server are you using? There are log reader tools out there that can read the transaction log, but they aren't free and they are for older versions as far as I know.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page

Pasi
Posting Yak Master

166 Posts

Posted - 2014-05-07 : 18:06:55
Is there any other way to get the rows back? I may have a back up


quote:
Originally posted by tkizer

What recovery model is the database set to? And what version of SQL Server are you using? There are log reader tools out there that can read the transaction log, but they aren't free and they are for older versions as far as I know.

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/

Go to Top of Page

tkizer
Almighty SQL Goddess

38200 Posts

Posted - 2014-05-07 : 18:41:13
If you have a backup, then restore it but use a different database name so that you don't overwrite the current database. After the restore, copy the data from the restored database:

INSERT INTO YourTable (Column1, ...)
SELECT Column1, ...
FROM RestoredDatabase..YourTable

Tara Kizer
SQL Server MVP since 2007
http://weblogs.sqlteam.com/tarad/
Go to Top of Page
   

- Advertisement -