SQL Server Management Studio: Recover Lost Files

You can write SQL which outperforms and is bug free.

Get your copy of my SQL Best Practices and start writing the SQL which sails through code reviews.

Cost? Pay what you want :)

Student or just starting your career? Give yourself a break and get it for free.

Database professional? Think about your hourly rate and how much time you'll save with crisp and clear best practices.
Contribute over $27 and I'll send you the Word version of the doc so you can easily customize it for yourself and your team.

Get SQL Best Practices

Nooooooooo!  Power outage+unsaved files SQL Server Management Studio files=Panic!!!  Wait a sec.  Don't panic.  Every modern application, especially Microsoft apps, prompts you after a crash and asks you if you want to recover your lost files right?  Right!?!  Somehow, SSMS does NOT include this feature.  Why?  No idea.  Blame Management Studio's stability.  It rarely shutsdown unexpectedly so perhaps this feature was deemed necessary?  (Visual Studio on the other hand crashes so regularly I'm guessing the ability to recover files was one of the first features added).

Don't fear!  There is a solution!  You can make your dead files come back to life.  SSMS does actually save the files it just doesn't prompt if you want to recover them after a crash.  Which means you just need to know where to look.  There are two possible paths which will reunite you with your zombie files.

C:\Documents and Settings\YourUsername\My Documents\SQL Server Management Studio\Backup Files\

Once at this location you should see a solution folder containing the files which were open when SSMS crashed.

If you find that this path doesn't exist (as one of my coworkers on Windows 7 did) you can try:

C:\Users\YourUsername\Documents\SQL Server Management Studio\Backup Files

(I'm sure one of you Windows gurus out there can explain that this is actually the same directory being mirrored on a different path because that's what it looks like.)

So let this be a lesson to you save often because you never know when there will be a power failure (or a zombie apocalypse).

Thanks to the wizards in the SQLServerCentral Forum for originally posting the path!

Zombie files: Yes. Real zombies: No.

Tags: , , , , , , ,

No comments yet.

Leave a Reply