Setting Different Colors for Connections in SSMS

  • Jeff Moden (3/13/2015)


    Carl Neirynck (3/13/2015)


    !!! Be aware that this ONLY works if you open a query window via Registered Servers!!!

    So if you connect to a server/instance through the Object Explorer or when SSMS opens it WON'T work.

    This bug has been there since 2008 and has never been fixed.

    This makes this "feature" very dangerous.

    Actually, the "feature" needs to be instituted in two places and then it operates as expected at all times. I'll see if I can dredge up the details for how to do that.

    Here's the link that explains the two places that you must setup in order to make this "coloring" work reliably.

    http://www.sqlservercentral.com/blogs/glennberry/2010/03/29/using-custom-connection-colors-in-ssms/

    --Jeff Moden


    RBAR is pronounced "ree-bar" and is a "Modenism" for Row-By-Agonizing-Row.
    First step towards the paradigm shift of writing Set Based code:
    ________Stop thinking about what you want to do to a ROW... think, instead, of what you want to do to a COLUMN.

    Change is inevitable... Change for the better is not.


    Helpful Links:
    How to post code problems
    How to Post Performance Problems
    Create a Tally Function (fnTally)

  • SQL server 2008 R2. Picked a random color to test and now cannot change it back. Even after deleting the server registration, the color stays at the ugly random color I don't want. How do I reset?

  • smssboost.com another nice euro utility, with a free community edition. does the color coding and a lot of other useful stuff

  • hello Peter, hi all,

    yes, this kind of coloring is really great.

    Still take care!!!

    Unfortunately this is not 100% reliable. I use these colors for about three years now, in SSMS 2008 and 2012.

    The tricky thing is the following:

    Open a query on your server, seeing the color you defined.

    Now use the command "change connection". In this dialog you again find the "connection properties" tab where you can define a color.

    For some reason (dear Microsoft, why???) this setting is NOT the same as defining the setting using the properties in the server registration.

    So far so bad. Now:

    If you open a query and use the "change connection" command, sometimes it happens that you change the connection to another server but the color does not change.

    If you check the color in the server registration everything is ok und you ask yourself what's going on.

    You have to use the "change connection" command once more, connect the server you are already at and change the color in the "change connection" screen.

    Unfortunately in still could not find a schema when this happens :(:exclamation:

    Peter, did you ever see this? Maybe you even know why and when this happens?

    I encounter this problem really rarely but if it happens it can be really annoying.

    Please, all of you, do not rely on the colors only, please still check the server you are connected.

    Nice weekend to all and have fun with your colors. Yes, I appreciate them too, every single day 🙂

  • I had the same problem, you have to set it in two places. Once under registered servers and once under Options>> when you change connections.

  • The article assumes you have registered servers. They have to be added first.

  • Thanks for sharing. This is very helpful and much needed feature.

  • Had no idea you could do this. This will really help me from doing stupid stuff in prod in the future :-D. I'll just make prod red and dev green

  • Little late in the discussion but if it helps someone... 
    ApexSQl is a free tool that can be used for tab coloring

    https://solutioncenter.apexsql.com/how-to-set-different-connection-colors-in-ssms/

Viewing 9 posts - 46 through 53 (of 53 total)

You must be logged in to reply to this topic. Login to reply