(SSMS) How do you prevent an open tab from querying a DB after disconnecting the server In SSMS if you have a tab open with a query and then you disconnect the database you can still run the query after disconnecting.

is there a way to prevent SSMS from running a query after server is disconnected?
The Object Explorer pane and the Query pane are independent. You can have the Object Explorer connected without having a Query connected, and vice versa. 

The menu option you probably want is Query -> Connection -> Disconnect. 

HTH