Category: Blog

  • Daily Coping 15 Oct 2021

    I 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. All my coping tips are under this tag.

    Today’s tip is to be a realistic optimist. See life as it is, but focus on the good.

    This is something I’m writing while in Belgium, earlier this week. I am optimistic in life, even as the world struggles in different ways with the pandemic. We are still moving through this, with various places and organizations trying to find ways to cope.

    I am at the first live technical conference I’ve been to in nearly two years. The event is following the local guidance in Mechelen in Belgium. Things have changed a bit since I submitted and was accepted to the event, and the conference was still viable as the date approached. My travels were fairly smooth, and I think, fairly safe. I know there are still challenges, there are people with different levels of comfort with crowds and greetings, and I respect their thoughts.

    From what I see, most people I’ve encountered in Chicago, London, Brussels, and Mechelen just adjust to the rules and how others feel. If someone asks for space, or requests a mask, wants an elbow bump, or is happy to shake hands, others oblige. That gives me hope and optimism for how we will grow and interact in the future.

    I also know that there are still risks involved, especially for unvaccinated people. This event is live, but not hybrid, which inherently cuts out some people that might not be able to attend or be concerned about health. There is a risk of spreading COVID 19, though everyone is supposed to be vaccinated or taking precautions. Travelers were tested coming into Belgium, which may or may not be 100% accurate.

    That’s the world. It’s reality. There is a balance of risk, precaution, reward, restrictions, and life that need to be weighed, but I am confident that most people are making good decisions and complying with the rules.

  • Daily Coping 14 Oct 2021

    I 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. All my coping tips are under this tag.

    Today’s tip is to look for the good in people around you today.

    I’m in the office today, but no idea how many people I’ll see. However, I was with a number of people recently in Colorado. I went to go watch a high school volleyball game, and I ran into a lot of people that I knew.

    I took a few minutes to think about what I appreciated about them, and what they’d done that was good. Not all of them were people I’ve gotten along with, or even liked seeing, but I did find things that they do that help the world.

    Thinking of those things made me smile.

  • Daily Coping 13 Oct 2021

    I 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. All my coping tips are under this tag.

    Today’s tip is to start with the most important thing on your to-do list.

    I’m in the UK today, so my to do list is what the company needs. However, I am actually writing this before I leave, thinking about fall life in Colorado.

    As winter approaches, we have a lot of things that need to get completed before the ground freezes and weather gets bad. It’s not often really bad, but it is more difficult to work during the short days, in chilly weather, and with other commitments. My current list is, in no order:

    • get the pastures cut (mowed)
    • blow out sprinklers
    • use or drain gas in mowers
    • clean out the shed to get a mower in for the winter
    • recharge/replace the generator battery for the house
    • rebuild the generator shed for the riding arena
    • paint some spots on the house
    • paint the master bathroom
    • do some maintenance on the BMW
    • change the Chevy oil
    • Change oil in the UTV and ATV on the ranch

    There are probably a few other things I’ve forgotten, but these are the main ones. I’ve slowly masked and painted a little some nights, and I’ve been trying to work on the pastures. The recommendation from the state agriculture board is cut early in spring or late in fall. I missed spring, so I started in September mowing. That’s about 40 hours of work.

    However, one thing I need to get done at the top of the list is close the sprinklers for the winter. It’s been warm in CO, so I haven’t been worried, but with a trip overseas, I can’t leave this. I went out and bought a air connector for the new pressure valve this weekend and then blew out the lines.

    One thing to cross off for winter.

  • T-SQL Tuesday #143 – Short Code

    T-SQL-Tuesday-LogoI’m late, but I wanted to get this out. I started the post, then got distracted with travel to Europe late last week.

    In any case, this month the host for T-SQL Tuesday is John McCormack, with his invite to write about short code examples. It’s a good technical invite, and one that immediately got me thinking about things I do often.

    If you haven’t ever tried a T-SQL Tuesday, set up a blog and put out a post on the topic, this week or whenever you read this.

    Snippets

    I work for Redgate Software, though I’d likely be using SQL Prompt no matter what. I was never thrilled with native intellisense, but SQL Prompt has been great. One of the things I like most about Prompt are the snippets, which let me insert code with a few keystrokes.

    Here’s a quick example. If I type “” in SSMS, I see this:

    2021-10-13 10_52_32-CandidateList

    Prompt detects this as a snippet first, then has other matches. I can hit Tab, and I’ll get this:

    2021-10-13 10_52_46-CandidateList

    I get a quick “top 10” from a table. Often I use SELET * for a quick look at the shape of data.

    However, I can add custom snippets, and one I use often is this:

    WITH myTally(n)
    AS
    (SELECT n = ROW_NUMBER() OVER (ORDER BY (SELECT null))
      FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) a(n)
       CROSS JOIN (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) b(n)
    )
    SELECT *
    FROM myTally

    This is my “tt” snippet, so I can type “tt<Tab> and get this code for a tally table. This s handy in many string manipulation and problem solving situations.

    If I need more than 100 rows, I can easily copy the cross join line, add a new alias, and I have 1000 rows with this:

    WITH myTally(n)
    AS
    (SELECT n = ROW_NUMBER() OVER (ORDER BY (SELECT null))
      FROM (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) a(n)
       CROSS JOIN (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) b(n)
       CROSS JOIN (VALUES (1), (2), (3), (4), (5), (6), (7), (8), (9), (10)) c(n)
    )
    SELECT *
    FROM myTally

    Short, but effective code.