SSMS v17.x Query Window forgets active database when reconnecting - Potential data loss
When a query window reconnects to an SQL Server instance (eg after resuming from sleep) SSMS v17 forgets which Database was associated with the query window and silently picks another one.
This means that if you try to run a query after the connection is lost, SSMS will reconnect then run the query against the wrong database. Best case the query errors; worst case you've just run a query against the wrong database with the potential to modify data you didn't intend to.
This affects all versions of v17 as far as I know (currently on 17.9). In previous versions of SSMS (2016 for example) the database was correctly remembered after re-connecting.
Tedious workaround if you remember to do it: Cancel the connection window when it pops up, re-connect manually (for every Query Window), select the correct database for the (again every) Query Window from the Available Databases dropdown, then run the query again.
I'm aware that best-practice is to always use [DBName].[dbo].[Table] for everything, but we don't live in a perfect world, especially with quick and dirty one-time queries ;)