Search code examples
sqlsql-serversql-server-2005recovery

Undo changes to SQL Server 2005 database


I've ran some "ALTER" scripts on the database [SQL Server Server 2005], and overwrote some sprocs. Is there any way to undo changes and get my old sprocs back?

Is there a way to get the scripts that were executed out of the .LDf file? That way i can re-run my initial "create" script for my sprocs.

I don't have a backup file with old sprocs.

p.s. i backed the DB up as per @Gulzar's deleted answer, and looks like I'm "hosed".

@Pittsburgh DBA: thanx for the solution, but it doesn't seem to work after the backup.

MORAL: Wait for 10 minutes before trying the suggested answers out


Update from Gulzar: What I meant was a file backup before trying anything (to be safe). Not a SQL Server backup.


Solution

  • FIRST: DO NOT TAKE ANY BACKUPS JUST YET.

    There are several tools on the market to do this sort of thing.

    You might try this one:

    ApexSQL Log