Monday, July 16, 2018

A quick 'save me from myself' thing in SSMS

Have you ever felt that 'down-elevator' feeling in the pit of your stomach when you realize you just executed a script against the wrong instance? I have.

It's of course possible to add name checks and all to only allow execution on a given instance, I'm going to go out on a limb here and guess that most people don't do that in most cases.

Happily, there's a quick and easy setting you can take advantage of to give yourself a visual indication that hey, maybe you're not where you thought you were: the 'Use custom color:' setting in the Connection Properties of the Connect to Server dialog box.

To get there, first click Options:

Check the box for 'Use custom color:', and hit 'Select...':

Pick your color, click 'OK' (I tend to use red for production, orange for QA/test, green for development, but go with whatever works best for you), and then click 'Connect':

From here on out, the status bar down at the bottom of the query window will be whatever color you've picked for that instance:

While various third-party tools offer similar functionality (often with a lot more flexibility and configurability), this is built-in to SSMS and has been around for quite a while. It's a great quick gut-check!

1 comment:

Anonymous said...

When starting out, the easiest sport to study is Jacks or Better. With optimal play, Jacks or Better can pay out ninety nine.5% over lengthy run|the lengthy term}. There is nothing worse than the 솔카지노 effort of having to travel hours simply to find out|to search out} the closest land-based casino to play video poker. Playing video poker on-line has turn into more and more extra in style for the large reason that you don’t should go wherever to play. Keep in mind that whenever you calculate the payback share for a video poker machine the number you arrive at relies on perfect play.