Solved

Hi help nedeed does any know if SQL2005 keeps a tempory copy of a strored procedure that has just been changed with an alter commnd

Posted on 2009-04-03
3
150 Views
Last Modified: 2012-05-06
I have accidently overwritten a stroed procedure I was developing with an alter command. Does SQL 2005 keep a tempory copy or backup of the original stored procedure anywhere.
0
Comment
Question by:NTSS
3 Comments
 
LVL 13

Accepted Solution

by:
St3veMax earned 250 total points
ID: 24058120
Sadly not.

Your best bet would be if you have a recent full backup that you can restore as another database; i.e. "YourDatabase_RESTORE"

HTH
0
 
LVL 12

Assisted Solution

by:udayakumarlm
udayakumarlm earned 250 total points
ID: 24058227
you can use the backup copy of the database then restore the same separately and extract the SP code. re run on the actual DB.
one more dirty way is to open the log file of the DB in a text editor and look for stored proc name. if lucky you may get the create statement in the log file
0
 

Author Closing Comment

by:NTSS
ID: 31566164
Many thanks for your help, unfortunatley I had been working on the stored proc for a couple of hours this morning and had not yet backed up the DB (my own stupid fault). The database is only for development and is set to simple logging. I just wander if sql happen to keep a temp copy of the alter stored proc is some un documented location.
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

There are some very powerful Data Management Views (DMV's) introduced with SQL 2005. The two in particular that we are going to discuss are sys.dm_db_index_usage_stats and sys.dm_db_index_operational_stats.   Recently, I was involved in a discu…
In this article I will describe the Backup & Restore method as one possible migration process and I will add the extra tasks needed for an upgrade when and where is applied so it will cover all.
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now