This is a useful little tip that I discovered today.
If SQL Server Management Studio (SSMS) ever crashes on you for whatever reason then there is a chance that you’ll lose whatever queries you had open at the time of the crash. Sometimes when you re-open SSMS it will ask you if you want to re-open any files that you recover but for some reason it doesn’t always do that and in that instance you may think that your work has gone for good.
Happily that’s not the case, not always anyway. Even if SSMS does not prompt you to recover those files they are probably still present on your machine. Go and check in your C:\Users\YOURUSERIDHERE\Documents\SQL Server Management Studio\Backup Files\Solution1 folder and you should find them waiting for you.
I’m sure most of you could have worked out where they were stored, the real trick is knowing that they are stored in the first place and now….you do!