SQL Server Forums
Profile | Register | Active Topics | Members | Search | Forum FAQ
 
Register Now and get your question answered!
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Accidental rows delete !! pls help.. 911
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

Pasi
Posting Yak Master

152 Posts

Posted - 05/07/2014 :  17:46:22  Show Profile  Reply with Quote
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

USA
37160 Posts

Posted - 05/07/2014 :  17:53:04  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

152 Posts

Posted - 05/07/2014 :  17:54:02  Show Profile  Reply with Quote
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

USA
37160 Posts

Posted - 05/07/2014 :  17:59:13  Show Profile  Visit tkizer's Homepage  Reply with Quote
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

152 Posts

Posted - 05/07/2014 :  18:06:55  Show Profile  Reply with Quote
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

USA
37160 Posts

Posted - 05/07/2014 :  18:41:13  Show Profile  Visit tkizer's Homepage  Reply with Quote
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
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.12 seconds. Powered By: Snitz Forums 2000