Auto Save / Auto recover in Management Studio?

  • I have come in today to find my PC rebooted, I suspect due to windows updates, (it decides to reboot with no warning sometimes I swear)

    Anyhow, I left management studio open with about 6 queries on the go, some of which were not saved, on the whole its no biggy today, as the important ones were saved, but it does mean some extra work to get back to where I was, kinda annoying.

    Is there no auto save / auto recover facility - I just opened Mgnt studio and it just opened as usual, no 'recover files' prompt or anything - I looked in the options for ages and didn't find anything, I also looked on the books online, again nothing. I googled for it and found someone who had recovered documents...

    And, here's the coolest part, I was working on some SQL files at the exact time of the disaster and well, I went to the \Documents and Settings\username\My Documents\SQL Server Management Studio\Backup Files\ directory and found a directory of Solution1. In it were 3 files with similarly ugly names (~AutoRecover.~vsC.sql, ~AutoRecover.~vsC.sql~RF93d469.TMP, etc...) and the AutoRecover file was 2KB (the others were 0KB). Anyway, I opened up the file and viola! I actually recovered the .sql script I was working on at the time I dropped my laptop (well, I still blame this on Paul cause he made me lean over to talk to him and this ultimately pushed my laptop off the crappy airline table 😉 😉 😉 :).

    So I guess it must be possible, I just can't find the options anywhere, and I don't have the directory she mentions either :/

    (Taken from this page: http://www.sqlskills.com/blogs/kimberly/2008/05/09/WhenDidYouLastBackupYourHomepersonallesscriticalSystemIsItReallyLesscritical.aspx )

  • In a bizarre twist of fate Management Studio decided to die around 30mins after this post, and then created the 'backup' folder in the location mentioned in the post above, and low and behold when it started it up again there was a prompt to recover files!

    Why it didn't do this after Vista killed it for a Windows Update I don't know, but at least in a power failure or a crash it looks to work...

  • SSMS (SQL Server Management Studio) do not provide any feature to turn off Auto Recovery/Auto Save option, but this will include in the future versions. Also, Microsoft will not encorporate this feature in upcoming Service Packs. Please go through

    http://connect.microsoft.com/SQLServer/feedback/ViewFeedback.aspx?FeedbackID=125840

    Regards

    Muhammad Sharjeel Ahsan

  • OMG!!!! That so saved my bacon. That directory;

    C:\Documents and Settings\Your Name Here\My Documents\SQL Server Management Studio\Backup Files\Solution1, contains a ~blah.sql file for the window that you were working at the time of the unfortunate event.

    Still no replacement for saving your scripts but....

  • The same thing happened to me and I followed your instructions and found the auto-saved files. Saved me a lot of rewriting. Thanks!

  • I faced the same problem and I followed the steps above. I could recover my files !! Helped me a lot ! Thank you... 🙂

  • thank you VERY much for posting the solution mentioned above. saved my a** at work today 🙂

  • thank you very much for this post.

    Best regards,

    Henrik Staun Poulsen

    http://www.stovi.com

  • Saved my day!!! Cannot thank enough as it's late in Friday afternoon...

  • Thank you so much! My PC rebooted during lunch and I would have lost hours of work...

  • Thanks a lot.

    You saved my day.

  • My SQL Server Management Studio is not saving files in the Backup folder....I have other boxes where it works but not on my laptop. Trying to find an option where to enable this feature but no luck. Anyone know how to turn it on?

  • Very handy, you made my day!:)

  • I faced the same situation when came to work this morning(PC rebooted for windows upgrade).

    I was tracking a issue for the past 3 days in SSMS. I lost the results (which were at point of time) :(. But atleast I could recover the queries.

    Thanks a lot!!

  • Saved me lots of work with this post after site wide power failure. Really great info thanks!

Viewing 15 posts - 1 through 15 (of 32 total)

You must be logged in to reply to this topic. Login to reply