Category: Blog

  • Daily Coping 28 Jan 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 take a small step towards an important goal.

    I try to set some career goals each year, things that I work on outside of, or in conjunction with, my daily work. Driving yourself forward is a challenge, and it can be easy to forget about your goals.

    I’ve got a few this year, one of which is pursuing some Azure certification. I do keep working with Azure in different ways, such as getting SQL Memorial going, but I haven’t been focused on leveling out my knowledge across the platform.

    Pursuing AZ-900  (Azure Fundamentals) is a goal, mostly because it will force me to dig into the platform. I recently took a couple hours to work through the learning paths, with a notepad and pen, taking notes and trying to grow and learn. I scheduled a couple meeting times for myself to focus, and hopefully I’ll continue to work on those in the coming months.

  • 2020 Advent of Code–Day 1

    This series looks at the Advent of Code challenges.

    I started the Advent of Code at the beginning of December 2020, but life quickly got in the way. Weekends especially, where I try to get away from the computer, so I fell behind. However, I did work through a few, and one of my goals in 2021 is to get through all of them.

    I’m going to document my solutions on my blog.

    Day 1

    The first thing I did was set up a template for the solutions. This is clearly important, and I used some basic ASCII art.

    2021-01-22 12_23_37-Day1.sql - ARISTOTLE.sandbox (ARISTOTLE_Steve (53)) - Microsoft SQL Server Manag

    From here, I tackled the challenge. This is one suited for databases, as there is the need to take a list of numbers and find two that add up to 2020. I created a simple table that contained a single column to store numbers.

    CREATE TABLE Day1
    (  datavalue INT)
    GO

    In here I inserted the test data from the challenge.

    The easy way for me to tackle this quickly was cross join the numbers with a sum. I put this in a CTE, which gives me the sum of all individual numbers.

    WITH cteCalc (a, b, sumab)
    AS (   SELECT
                           a.datavalue, b.datavalue, a.datavalue + b.datavalue AS sumoftwo
            FROM
                           Day1 a
                CROSS JOIN day1 b)

    Once I had this, in the outer query I added a WHERE that limited the results to the sum being equal to 2020, and for the column list, I produced the product.

    WITH cteCalc (a, b, sumab)
    AS (   SELECT
                           a.datavalue, b.datavalue, a.datavalue + b.datavalue AS sumoftwo
            FROM
                           Day1 a
                CROSS JOIN day1 b)
    SELECT a, b, a * b AS solution
    FROM cteCalc WHERE sumab = 2020;
    go

    This gave me the result.

    As a hint, I used BULK INSERT to load the complete data from the test file into my table.

    Part 2

    Each challenge has two parts, with the same data. In this one, I had to find 3 entries that summed to 2020. I just added another cross join and this was solved.

    WITH cteCalc (a, b, c, sumabc)
    AS (   SELECT
                           a.datavalue, b.datavalue, c.datavalue,
                           a.datavalue + b.datavalue + c.datavalue AS sumoftthree
            FROM
                           Day1 a
                CROSS JOIN day1 b
                CROSS JOIN day1 c
        )
    SELECT a, b, c, a * b * c AS solution
    FROM cteCalc WHERE sumabc = 2020;
    GO

    All in all, an easy day. Now I need to solve this in Python.

  • Daily Coping 27 Jan 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 get back in contact with an old friend you miss.

    I’ve had a great life and been able to meet many people. Some of these have become friends, and at times, life has taken us in different directions. Some of my friends are people I used to work with, and for a few of these, I’ve made time to visit them when I am in their area.

    That hasn’t happened in a long time, well over a year at this point.

    I reached out to someone recently that I haven’t seen in a long time, just to touch base, say hi, and have a conversation. It was 10 minutes out of my day, but 10 minutes that made me smile. I hope they can say the same thing.

  • Daily Coping 26 Jan 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 focus on what’s good today, no matter how tough.

    I have mostly good days through the pandemic, though some are certainly hard. A few weeks ago, I had a tough day. Gareth Swanepoel passed away, which was a shock. I attended his funeral remotely on Zoom, tears falling.

    Gareth wasn’t a close friend, but he was someone I knew fairly well and had interacted with many times over the years. I could appreciate his smile and his infectious positive attitude towards life.

    The good was that I sat and remembered him, and appreciated some of the good times we had.