Category: Blog

  • Color Coding a Database on All Servers with SQL Prompt

    SQL Prompt has some nice color coding features, but sometimes I want a database to keep the same color, regardless of instance. I don’t know that I’d recommend this, but since I work in demo environments across versions, this is a handy trick for me.

    In the SQL Prompt menu, there is an options item.

    2020-07-11 10_39_15-

    Clicking this brings up a dialog with a number of sections along the left and details on the right. Near the bottom is the color menu.

    2020-07-11 10_39_26-SQL Prompt – Options

    When I decide to color code a database, I click “add” and I get this view. The cursor defaults to the Server/Group edit box, and I’ve typically entered a server name here.

    2020-07-11 10_39_39-SQL Prompt – Options

    However, I can skip this and just enter a database.

    2020-07-11 10_39_51-SQL Prompt – Options

    In this configuration, every time I open a query window to a database called SimpleTalk_1_Dev, no matter which instance, it will be colored purple.

    I can see this when connecting to my default local instance.

    2020-07-11 10_40_01-SQLQuery2.sql - ARISTOTLE.SimpleTalk_1_Dev (ARISTOTLE_Steve (52))_ - Microsoft S

    I also test things on a v14 (SQL 2017) instance, and if I connect there, I see the same thing.

    2020-07-11 10_41_08-SQLQuery6.sql - ARISTOTLE_SQL2017.SimpleTalk_1_Dev (ARISTOTLE_Steve (60)) - Micr

    In some sense, this is an edge case. I demo similar things across instances and versions, and it’s nice to keep colors simple rather than entering dozens of instance names. However, it’s not something many people do, as they often use the same database name on different instances. That’s a more common scenario.

    That’s supported as well. Notice here I’ve entered just a server with no database.

    2020-07-11 10_47_12-SQL Prompt – Options

    Now every database I connect to on this instance will be colored green. Note that the purple still overrides because it is specific to a database. The third tab below is connected to the SimpleTalk_1_Dev database.

    2020-07-11 10_47_19-SQLQuery6.sql - ARISTOTLE_SQL2017.SimpleTalk_1_Dev (ARISTOTLE_Steve (60)) - Micr

    SQL Prompt has some amazing features, but color coding is one that helps me keep track of which databases and instances I’m connected to in a query window. If you‘ve never configured this, give it a try.

    If you’ve never tried SQL Prompt, it’s incredible. Download an eval today and see what you think.

  • Daily Coping 22 Jul 2020

    I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

    Today’s tip is to write your worries down and save them for a specific “worry time”.

    What am I worried about? Not much, and my worries are really small. I worry my daughter won’t get to experience college this fall, including sports, and I won’t get to watch her play. I’m worried my middle kid won’t get a job when he graduates next year. I’m worried my oldest will get sick, or stuck, in Spain this year where he’s supposed to teach. Or that he won’t go.

    Mostly I worry that I won’t be able to get back to my way of life, speaking, travel, coaching, and snowboarding. This is a good way to write a few things down, and I’ll worry about these on the weekend, when I can have a drink with my wife and complain about things.

  • Daily Coping 21 Jul 2020

    I’ve started to add a daily coping tip to the SQLServerCentral newsletter and to the Community Circle, which is helping me deal with the issues in the world. I’m adding my responses for each day here.

    Today’s tip is to get the basics right: eat well, exercise, go to bed on time

    This is my go to coping tip, well, two of the three. Or maybe three of three, depending on how you view things.

    First, exercise. This is something that’s important to me, as evidenced on my workout log for June. July is looking slightly worse, but I had a few interruptions.

    2020-07-16 09_33_41-MapMyRun

    I find exercise is a great break from life for me, but it’s also a good long term habit to build for your health. At least walk around regularly.

    I like my bed, and I look forward to sleep. I do try to get to sleep early, with complaints from my wife that I can’t stay awake, but I have been struggling the last month to stay asleep. I seem to wake up at night, wide awake, and can’t get relaxed. Sometimes I lay there, sometimes I read a bit. I don’t feel too stressed and my diet hasn’t changed. I’m guessing I’m just getting old.

    That brings me to eating. Food comforts me. While I try to cook more vegetables for the family and look for healthy alternative recipes, I’m not great at it, and I’m not great at limiting portions. I am trying to do better, and it’s on my mind, but doing better is a struggle.

    Be better than me today.

  • Azure DevOps Changing Build Notifications

    I don’t do a lot of team builds in Azure DevOps, but I constantly use it for demos. However, I’m often experimenting with things and I break builds regularly. I used to show the email notifications to audiences years ago, but I think Continuous Integration (CI) has become fairly common and people are used to getting notified on failures.

    These days I find myself constantly getting success notifications, which are annoying. Instead, what I’d like to do is avoid these and only get build failures. This is a quick post of making this change.

    I am doing this for a project, but you could do this for all projects. In my case, I’ll pick the project settings at the bottom of the main page.

    2020-07-09 15_27_58-

    This opens a list of items on the left, one of which is notifications.

    2020-07-09 15_20_03-Settings · Notifications (SimpleTalk DB Demo - Basic) - Settings

    Select this and you see a number of default notifications set up. The top one is in the “Build” section and is for a build completing. We don’t need to know builds complete. In fact, I wouldn’t ever want this notification, even in a team. I assume most complete and only want failures.

    This is enabled, but I’ve clicked the slider to disable this below.

    2020-07-09 15_20_13-Settings · Notifications (SimpleTalk DB Demo - Basic) - Settings

    Now I want a build failure notification. At the top there is a “New Subscription” area to select.

    2020-07-09 15_22_42-Settings · Notifications (SimpleTalk DB Demo - Basic) - Settings

    This opens a list of various subscriptions you can set up. The first item is build, and you can see on the right that I can choose the build complete or failure. I assume this is because I may want to alter the default settings for the completion.

    2020-07-09 15_22_49-Settings · Notifications (SimpleTalk DB Demo - Basic) - Settings

    I pick this and see some settings I can configure. I can change the name, decide who gets notified and even set this for all projects. I like these custom dialogs, letting me pick a number of criteria that I Can link in an and/or fashion.

    2020-07-09 15_23_05-Settings · Notifications (SimpleTalk DB Demo - Basic) - Settings

    That’s it. Now when I run builds, I don’t get notified if there is success. Only failure.