Or did you?
One of the projects I’m working on is running on Azure VMs with auto shutdown enabled. This means that if I’m not quick enough, the VM shuts down with everything in it. Including that very intelligent query that took me hours to build but failed to save.
You’ve been there; we’ve all been there.
But the query isn’t exactly lost. Because every query window is saved in a special folder. Usually, SSMS will prompt you that there are unsaved queries. In my case with 18.8, it doesn’t.
Where can you find your lost queries?

In this folder on your machine, the auto-recovery files are saved.
If you’re missing the Visual Studio 2017 folder, the files might live in the Visual Studio 2019 folder with the appropriate subfolders. But the main thing is, you won’t lose your files quickly.
With the newer version of SSMS, you won’t find anything in the above folder.

This one will hold the correct ones!
Also, now with SSMS 22, you can let is autosave your state and reopen where you left off.

On the other hand, if you log in with someone else’s credentials, it is possible to see what they were up to…
Thanks for reading!