Author: way0utwest

  • 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.

  • Remembering the Past

    Just a short time ago, the SQL Family lost Gareth Swanepoel. It was fairly sudden and sad to have someone I knew fairly well pass away. He was the first person that I directly knew that was lost to the COVID-19 pandemic.

    I’m getting older. I seem to hear about a person I’ve known passing away almost every year now. I know I’ve got more life behind me than in front of me, and I cherish the moments I do have and the memories of others.

    A few years ago Andy Warren and I were talking about this subject. This was after we lost a common friend, and we wanted to have some way to remember them. We kicked around a few ideas, but other than adding an “Obituaries” category to Database Weekly, I didn’t do much.

    I decided to change that after I heard about Gareth. While processing my grief, I bought sqlmemorial.org and started to put something together. I’ve been hearing about Jekyll and I spent a little time messing around with it. I ended up deciding to put this up and start ensuring that we have a way to remember the people that have taught and touched us. I’ll also share some articles on how I put this together.

    I set this up as a GitHub repo, and I am taking pull requests for people that want to add a memory, a link, a picture, or something else. I’m also hoping that people will let me know as others pass, a sad fact of life that we will continue to experience in the years to come.

    I’m hoping this helps me, and many of you, fondly remember the people in our SQL Family.

    Steve Jones

  • 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.