Using SSMS under sql08Express.
In past installations of SSMS, if windows fired a restart and forced open applications to close, the editor would automatically re-open the active query windows when the app restarted. Now I can’t find that property setting.
IOW, when Windows installs patches overnight and auto-restarts, all my adhoc query windows are discarded and not restored when I re-open SMSS.
You can edit the following registry key and set the Value of the AutoRecover Enabled to 1(one).
HKEY_CURRENT_USER\Software\Microsoft\Microsoft SQL Server\100\Tools\Shell\General\AutoRecover
Also check the value of AutoRecover Always Enabled and bump it to 1 (one) in the same key.
EDIT:
I created a VM to double check this for Express Edition, and the above key doesn’t exist until you open SSMS for the first time. The Autosave files are kept in :
\SQL Server Management Studio\Backup Files\