Sql-server – Microsoft SQL Server Connection Coloring

sql serversql-server-2012ssms

I've been using the Redgate Query Tab Coloring feature (under SQL Prompt's Experimental Features) and I really like it. Somehow I've never known until today that this feature is built in to SSMS for Status Bar coloring.

My question is, with either Redgate, SSMS, or SSMS Tools Pack, is there some way to set a policy or something on the Microsoft SQL Server instance itself that will cause any SSMS clients to be colorized? Our server is running SQL 2012 SP2 and SSMS clients are either 2014 or 2012 SP2, also.

Let's just say there are some error-prone co-workers that have been known to execute queries against an instance thinking it's TEST or DEV and it ends up being PROD. We're all human I guess, but anything that can help would be really great. And I don't want to rely on the other people to set the coloring settings (because I know some of them won't). I know, I know, everyone shouldn't have PROD access, but that's another battle I need to fight.

Red Gate implementation:

enter image description here

Built-in SQL Server Management Studio implementation:

enter image description here

Best Answer

Boiling down the question to the basics:

Q: "is there some way to set a policy or something on the Microsoft SQL Server instance itself that will cause any SSMS clients to be colorized?"

No. SSMS query color-coding is part of a client-side connection and that data is stored in the registry. You could theoretically export that registry setting and apply it to anyone in your company with SSMS, but it's not a trivial task for us database people.

I'd take that request to your sysadmins with Active Directory Group Policy administration duties and explain what you need. It's a fairly common type of request for companies that manage software deployments centrally. Unfortunately, it's not point-and-click easy, and you'll need to update the registry keys every time you add or rename a production server. These types of mass client deployments usually require change requests because modifying the Windows registry isn't something you want to be doing often.