I just want to share quickly very handy tip regarding your SQL query sessions. When you open SQL queries in SSMS, you generally go on and work in newly opened pane/window but sometimes dont save that work.
SSMS by default saves them in the event of pre-mature closure or crash of SSMS or PC restart etc. You can find your SQL queries from following lcoation.
C:\Users\<UserName>\Documents\SQL Server Management Studio\Backup Files\Solution1
FYI, I have found my queries here:
P.S. I am using Windows Server 2008 Operating System. This path could vary based on the Operating System. You can figure it out for sure 🙂
I hope you find this interesting and helpful.