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 2005 Forums
 Transact-SQL (2005)
 deleted sp

Author  Topic 

ann
Posting Yak Master

220 Posts

Posted - 2009-09-18 : 18:51:37
Ok - it's Friday afternoon and all I can think of ... "It's Friday afternoon AND A PAY DAY!!".. so with thoughts of this, I stupidly deleted a stored procedure that I just created an hour earlier.

Is there anyway to recover it? It's not backed up, since it was pretty new when I deleted it ... sigh ....

Bustaz Kool
Master Smack Fu Yak Hacker

1834 Posts

Posted - 2009-09-18 : 19:07:50
We've all been there. That's not much consolation but it's about all I've got.

Can you get a hold of the script that the sproc was created from? In SSMS? In the clipboard?

If not, take solace in the fact that you'll probably do a much better coding job when you re-create the procedure.

=======================================
Men build too many walls and not enough bridges. -Isaac Newton, philosopher and mathematician (1642-1727)
Go to Top of Page

ann
Posting Yak Master

220 Posts

Posted - 2009-09-18 : 19:13:31
Well that totally blows what was otherwise a perfect Friday afternoon.... looks like I'll have to recreate it this weekend - (quitting time is accounted for and it does NOT include working overtime on a stored procedure that I already wrote :)

Was wondering though, when a sp or anything else for that matter, gets deleted - where does it end up? I know it's not in the recycle bin (am all too familiar with recovery from the recycle bin)
Go to Top of Page

robvolk
Most Valuable Yak

15732 Posts

Posted - 2009-09-18 : 21:24:16
Two words: source control.

If your database is not in Simple recovery, you could try backing up the log. Restore your backups to another database, and restore the log with a STOPAT option to the time just before you dropped the procedure. You may be able to recover it from that.

Again: source control. It is your friend.
Go to Top of Page
   

- Advertisement -