Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 

Using Custom Connection Colors in SSMS

One of the new features that was added to SQL Server Management Studio (SSMS) in SQL Server 2008, which was continued in SQL Server 2008 R2, is the ability to set custom connection colors for individual instances of SQL Server. The color you set shows up in the bottom of the query window in SSMS. This allows you to do things like set red for Production instances and green for development instances.

In order to get this to work reliably, you need to set it in two different places in SSMS. First, the Connect button in the toolbar. You have to switch to the Connection Properties tab, and set the “Use custom color” for that instance. Next, you need to go to that same instance under Registered Servers, and then set the same color on the Connection Properties tab.

This will make SQL Server use that custom color whether you you are opening a new connection or changing an existing connection. If you don’t set the custom color in both locations, you will probably run into issues where the color does dot always change as you expect it to.

image

Comments

Posted by Simon Sabin on 29 March 2010
Posted by Dukagjin Maloku on 29 March 2010

For me works fine and no problem till today!

Posted by cmille19 on 29 March 2010

Glenn,

You can also use PowerShell to set the connection color property (useful if you want to change the connection color on many servers).

Since the color attribute is stored as a number, we'll need to first lookup the number by setting the connection color in SSMS for one server. Using sqlps (SQL Server 2008 PowerShell host) cd to your server group,in this example I'm using a group named 'MyGroup.' List the connection color information for all serves in that group.

cd 'SQLSERVER:\SQLRegistration\Database Engine Server Group\MyGroup'

dir | select name, usecustomconnectioncolor, CustomConnectionColorArgb

To the set the color via PowerShell cd to the server group you want to change the color connection. Run dir again, specifying use custom color and the color number. Changing some SMO properties including connection information requires running the alter method. In addition you may need to close and re-open SSMS for the changes to take effect.

cd 'SQLSERVER:\SQLRegistration\Database Engine Server Group\MyGroup'

dir | foreach {$_.usecustomconnectioncolor = $true; $_.CustomConnectionColorArgb = -65536; $_.alter()}

Note: There is a bug in CMS where connection color information is not retained. The bug occurs whether you set the color information using SSMS or sqlps. This does not effect servers registered locally. A co-worker filed a connect item filed, please vote:

connect.microsoft.com/.../connection-properties-are-not-retained-when-servers-are-registered-under-a-central-management-server

Posted by Seth Phelabaum on 29 March 2010

You can also use SSMS tools (http://www.ssmstoolspack.com/)  to accomplish this goal all the way back to SQL 2000.  Wonderful little set of utilities... I'll throw together a post this week on the things I use it for.

Still haven't found something that highlights the actual *tab* though, which is what I'd really love.

Posted by Anonymous on 29 March 2010

Pingback from  What Are The Components of CD Jackets? | CheapGalaxy.info

Posted by Anonymous on 30 March 2010

Pingback from  What photoshop program is the best to use for anime? :The Photo Corner

Posted by Anonymous on 30 March 2010

Pingback from  How can I make a split screen in Final Cut Pro? :The Photo Corner

Posted by Anonymous on 7 April 2010

Pingback from  A Phantom Review

Posted by peleg on 4 July 2010

how can i define, that a user (and new user to)

,double click the icon that open the ssms, they will have

in the "use custom color" the color that i want?

(i want this to happen on the same computer for diffrent users)

Leave a Comment

Please register or log in to leave a comment.