In SQL Server Management Studio we can set the colour of the status bar when we’re connecting to a particular DB. This is useful to distinguish between different environments such as DEV, UAT, PROD etc. and should decrease the chances of us doing something silly on the wrong DB environment.
As shown below the colour can be set in the Options -> Connection Properties tab when we are connecting to a new server.
The colour can also be set for registered servers.
Different colours for multiple databases on SAME server
If you want to set different colours for multiple DBs on the same server, this can be done but from what I’ve seen only from the context of registered servers.
I couldn’t see how to do this when just connecting normally as if you try to connect to an already connected server but with different explicitly set DB name SSMS will just show it as one connection as the server name is the same …
… BUT …
If you use the registered servers feature which I posted about a few weeks ago you can add registrations to a Server/DB/Colour combo and then instead of double clicking the registration to open a connection (which like above SSMS will only open one per server) you right click and go straight to ‘New Query’. The colours are shown in this case.