3

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

  • 2
    SQL Server itself doesn't support it directly, but you could likely make a Windows-based Group Policy to make the change company wide. – Max Vernon Aug 8 '14 at 2:18
  • Perhaps this can be sorted via security to restrict production access? – gbn Aug 8 '14 at 7:26
  • @gbn the last sentence of my question talks about that. Access control is a major issue that needs to be addressed in the organization. Regardless though, I think this is a feature that I honestly think everyone would/should use (not just my company, but EVERYONE). A red bar for PROD queries isn't something anyone should turn down :). We are human after all... – Adam Plocher Aug 8 '14 at 8:20
  • @MaxVernon hello again Max, and thank you for your response. Are you able to elaborate slightly? I'm familiar with GPO basics but nothing more than tweaking some flags and simple settings. I have setup some registered SQL servers under "Central Management Servers", and setting the colors in there works fine until I close and reopen SSMS - it's as if that setting only saves to memory and never to the Mng Srv... Using this approach would suffice (not quite what I wanted), but only if it saved and could be reused by other devs. I'm not really sure where to start with the GPO stuff. – Adam Plocher Aug 8 '14 at 8:24
1

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.

|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.