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
 Old Forums
 CLOSED - General SQL Server
 accidently executed delete command on the db
 Forum Locked
 Printer Friendly
Author Previous Topic Topic Next Topic  

AskSQLTeam
Ask SQLTeam Question

USA
0 Posts

Posted - 09/20/2006 :  07:23:02  Show Profile  Visit AskSQLTeam's Homepage
Deepak writes "SQL Team,
Accidently i have executed delete command on my db without specifying the year and it deleted all the data . query is mentioned below:

delete from game_type1 where facility_id in(select facility_id from facility_details where facility_name='Madill GC' or facility_name='Goldsby GC') and month(convert(varchar(10), data_date, 101))=9

Is there any way that i can recover the deleted data and restore it again. It will be a great help for me . It can save my job.

Thanks in advance.

Thanks,
Deepak"

OBINNA_EKE
Posting Yak Master

234 Posts

Posted - 09/20/2006 :  07:25:05  Show Profile
Tell you DB Admin to restore it now

If it is that easy, everybody will be doing it
Go to Top of Page

harsh_athalye
Flowing Fount of Yak Knowledge

India
5581 Posts

Posted - 09/20/2006 :  07:26:18  Show Profile  Visit harsh_athalye's Homepage  Click to see harsh_athalye's MSN Messenger address  Send harsh_athalye a Yahoo! Message
Your only option is to restore latest backup else God help you !

Harsh Athalye
India.
"Nothing is Impossible"
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 09/20/2006 :  09:28:07  Show Profile
I'm sorry that this won't help you now but...

For you and anyone else that has access to production data and needs to perform deletes and update statements directly on that production data, here are a couple tips:

1. write the DELETE or UPDATE statement but before you execute it, change the command to SELECT. Look at the selected results and confirm they are only the rows you want to change.

2. issue a BEGIN TRAN before the statement, confirm the results then issue either a COMMIT or ROLLBACK accordingly. Keep in mind that while the transaction is open you may be blocking access to those tables/rows.

3. (this should really be number 1)
Hopefully you have a development/qc environment that developers only have access to. The statements can be run there first then after successfull verification, submit the script to an Operations/DBA person who is one of the few people with access to production servers for them to run.

Be One with the Optimizer
TG
Go to Top of Page

X002548
Not Just a Number

15586 Posts

Posted - 09/20/2006 :  09:29:48  Show Profile
It's dead Jim

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam
Go to Top of Page

TG
Flowing Fount of Yak Knowledge

USA
6062 Posts

Posted - 09/20/2006 :  09:33:25  Show Profile
quote:
Originally posted by X002548

It's dead Jim

Brett

8-)

Hint: Want your questions answered fast? Follow the direction in this link
http://weblogs.sqlteam.com/brettk/archive/2005/05/25/5276.aspx

Add yourself!
http://www.frappr.com/sqlteam





- ^
 -
Indeed!

Be One with the Optimizer
TG
Go to Top of Page
  Previous Topic Topic Next Topic  
 Forum Locked
 Printer Friendly
Jump To:
SQL Server Forums © 2000-2009 SQLTeam Publishing, LLC Go To Top Of Page
This page was generated in 0.08 seconds. Powered By: Snitz Forums 2000