Add Some Color to Your SSMS
Colors Are Spice For Your Eyes
One of the definitions of color at Dictionary.com is
the quality of an object or substance with respect to light reflected by the object, usually determined visually by measurement or hue, saturation, and brightness of the reflected light; saturation or chroma; hue.
That is quite a mouthful for something we can just look at and instantly appreciate. Colors are a natural occurrence. Colors can spice up a day in the mountains making it more enjoyable compared to the bland look of winter or the constant lush green of summer.
Colors Can Be Useful Too
Colors can, of course, be more than eye candy. They can be useful or have meaning. Insects tend to be attracted to bright colored flowers. Most people understand the concept of a stop light with its red, green and yellow colors.
What about colors in our development work? Of course most of us use syntax highlighting. I do not want to get into it, but I will concede that there are some who feel syntax highlighting gets in the way or distracts from the code. For me the syntax highlighting helps me cue in on parts of the code without having to read it in detail. It isn’t perfect, but it is a quick cue as to what something might be used for or its reason for being where it is located.
That my friend is the core of this post. A simple use of color in our SSMS.
Coloring Your SSMS
I know this feature has been around for quite some time. In fact some of us may take it for granted while there may be others who don’t know about it. Still others might not think it useful at all.
When you open your connection dialogue there is a button labeled Options. If we click on that button we are presented with yet another dialogue.
Specifically I am talking about the Connection Properties tab in this dialogue box. You can see at the bottom a check box for Use custom color.
This little box and its color picker is what allows us to add some color to our SSMS. If you are like me, it will also allow you to add some meaning to it.
While you have the full use of colors I personally tend to use just a few. I base them on the database server to which I am going to connect.
Red for production servers, orange for UAT servers, yellow for QA servers, and of course green for dev servers.
It does not happen often, but sometimes I might need to connect to different servers at once and even run the same basic query. What I don’t want to do is modify the wrong server. While you can control this with security, you may still need the same access across servers.
Once you enable a color for your connection it will color the bottom area of your query. This can act as a visual cue as to what server you are using. Now if you are connected to the right database is a different story.
There is another option outside of this default SSMS behavior. Red Gate makes a nice product called SQL Prompt. Among other things it colors the tab as well.
I hope you found this post useful and will add some color or spice to your SSMS.