0

Database: SQL Server 2012 Name of Store Procedure: dbo.sp_ins_output_str Date overwritten: 2014-06-26 (yesterday)

I have a SQL Server stored procedure thats overwritten by accident and executed, how can I recover/roll-back this store procedure to its original state..?

user2983978
  • 21
  • 1
  • 2

1 Answers1

0

There's no "Undo Button" per se, but you can get it back using the following method.

  1. Restore the database to a different location, recovering to a time prior to the alter being executed
  2. Extract the DDL of that SP from the restored location
  3. Alter the current erroneous SP using the DDL taken in Step 2
  4. Drop the restored database
  5. Feel heart rate decrease

Though if you have no backup, you're out of luck unless you have a CVS that contains all your DDL.

John Eisbrener
  • 642
  • 8
  • 17