Auto Recovery Scripts is also one of the helpful features introduced in SQL SERVER 2012. It is GOOD NEWS for those who generally forget to save the scripts in SQL Server Management Studio (SSMS) or for some reason could not save the script or close the SSMS abnormally with scripts. By default in SQL SERVER 2012 (SSMS), this feature is turned on with default settings.
Location of Auto Recovery Option in SSMS :
This option is available in Tools >> Options >> Environment >> AutoRecover
Settings available in Auto Recovery :
Given below are the settings available in Auto Recovery.
- Save Recovery Information :
- You can set after how many minutes your script should be saved automatically. By default it is after 5 minutes.
- Keep auto recovered information :
- You can also set for how many days SSMS should keep those files. By default it is 7 days.
You can find the recovery files here :C:\Users\windows user\Documents\SQL Server Management Studio\Backup Files\Solution1
Given below are the images of recovered files :
Reblogged this on Sutoprise Avenue, A SutoCom Source.
As a warning:
This only works on saved scripts, this has always been happening in the background, even on unsaved scripts since 2005, however as of 2012, it no longer auto-saves an open query window unless it has been saved manually first. Currently there doesn’t appear to be a solution.
The only work arounds for 2012 seem to be third party add-ons. So far SSMSBoost and SSMS Tools pack both have some autosave/recovery functionality that applies to unsaved scripts.