Author: way0utwest

  • A New Word: Gnossienne

    gnossienne– n. the awareness that someone you’ve known for years still has a private and mysterious inner life.

    One of the things I’ve learned throughout my life is that we really don’t know what it’s like for others in their lives. What their relationships are like with family, what really matters to them, what really excites/scares/motivates/repels them. We might have an idea, but I always think of this:

    “Well, we all have a face
    That we hide away forever
    And we take them out
    And show ourselves
    When everyone has gone” – The Stranger, Billy Joel

    When I think of that song, I sometimes think of people I thought I knew, but realized that I didn’t. Social media distorts this more and more, as very few people are willing to share anything that isn’t positive or amazing. Even the challenges people disclose, are minimized or only partially explained.

    This has been especially prevalent with friends and family who have gotten divorced. In some cases, I had no idea someone wasn’t happy in their personal life. In others, I knew there were issues, but had no idea how closely they were to separation.

    Everyone has a face they don’t show to anyone, or at least, anyone but their partner.

    From the Dictionary of Obscure Sorrows

  • Admin Rights for Everyone

    I was chatting with someone that works at a smaller organization Still a few hundred employees, but the technical teams (dev and ops) were less than 20 in total. They mentioned that everyone had admin rights to the systems as they worked as a team and sometimes developers provided production support.

    I haven’t encountered that in quite some time. Is it still a thing to give a lot of people administrator writes across many systems? I know for many organizations there is concern about developers being able to change things in production, but if you aren’t a public company or a regulated one, then Sarbanes-Oxley, HIPAA, PCI-DSS, or other restrictions don’t apply. In those cases, if you have a tight team that functions together, would you be worried about this practice?

    My perspective is that I am worried, and I’d still want to restrict production access to a few. I might allow developers to merge code and approve pipelines to run, but I’d want to ensure there are audit trails. Ideally, I’d even restrict DBAs and others from using their credentials and force them to use pipelines, but I know reality. In the moment, during a crisis, they might need access in a quicker way that allows interactive work.

    Sometimes production issues are hard to diagnose without being on the actual system.

    What I might want to enable instead is a specific account (or a few) for sysadmins that can be used for production access, but with an extended event trace limited to capturing just their actions and all their actions. This wouldn’t trigger for most activity, but it would if an admin accessed the system. In my mind, this is less about a worry of malicious activity by an admin and more a way to ensure log all actions so we can troubleshoot mistakes.

    I’m sure none of you make mistakes in a crisis, but I do. For my own safety, I’d want a record of my actions.

    I might even set a policy of screenshot recording as well. Many of us work in SSMS, and it’s easy to forget if we ran a query, or what the results were. SQL History in SQL Prompt saves me often if I forget what query I ran, but it doesn’t capture results. If I’m running scripts, whether DDL/DML or clicking in SSMS, I would like a record of what happened. An audit trail we can review.

    I do try not to click things in SSMS in production, and instead copy/save the scripts and then run them. It’s a better habit, but in a crisis, I know I might forget, as would others, so putting a system in place to capture actions is helpful. Recording your screen is an easy way to do this.

    Admin rights widely distributed have been shown to be a bad idea, especially in the era of ransomware, social engineering, etc. However, some entity needs them, so try to ensure you have good governance around actions taken. Just in case someone makes a mistake.

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

    Note, podcasts are only available for a limited time online.

  • Using the SIGN() Function: #SQLNewBlogger

    I was trolling the docs and noticed the SIGN() function. I have never written this in production code, but it is an interesting function. This post looks at where I might use this and when the need arises.

    Another post for me that is simple and hopefully serves as an example for people trying to get blogging as #SQLNewBloggers.

    How It Works

    The SIGN() function works by taking an argument and evaluating if the value is positive, negative, or zero. The example in the MSLearn Docs shows the values working in a few ways. I’m reproducing that here to look at how it works.

    2026-08_0196

    If I change this to work with float and strings, we get similar values.

    2026-08_0199

    Essentially, this implements this code:

    IF @value > 0 SELECT @value, 1
        IF @value = 0 SELECT @value, 0
        IF @value < 0 SELECT @value, –1

    Or this code:

        CASE WHEN @value > 0 THEN 1
        WHEN @value = 0 THEN 0
        WHEN @value < 0 THEN -1
        END AS valsign

    This is a simple function, and it’s easily duplicated in code, so why use it?

    Use Cases

    Most of the mathematical algorithms I’ve implemented don’t deal with negative numbers in a material way. Aggregates, such as averages and sums will take the value into account and the sign isn’t important.

    In some cases, it might. Perhaps I want to do some math around distances from zero, but I don’t want the values to cancel each other out. For example, maybe I have a small data set. I have some shipments and weights.

    2026-08_0207

    Now, it makes sense that we’re shipping to and from our warehouse and tracking the direction with a negative quantity for returns. However, to calculate total shipping weight, a sum doesn’t work:

    2026-08_0209

    I really want to normalize the values. I could use SIGN() here, as shown:

    2026-08_0210

    Of course, ABS() works as well, so that’s not necessarily a great example. I’d argue both are slightly obscure without a comment in the code.

    2026-08_0211

    Another example, perhaps I’m looking to determine a trend of movement. I saw this on the Internet from someone else.

    If I run this code, I’m getting the change of values, but also the direction of travel. That TrendDirection lets me know which ways things changed.

    2026-08_0202

    I might want to look for (or alert on) a trend. So, if I look at lines 14-17, I have a trend of increasingly negative values. Perhaps if I have 3 in a row (a complex LAG), I raise an alert.

    Here’s a LAG with SIGN repeated to show that.

    2026-08_0205

    There are other cases I might care about, but these come to mind.

    SQLNewBlogger

    This is an example of a post that shows I know how a function works, but mostly where I might use it. I added my own thoughts, and a couple of use cases.

    This post took about 40 minutes to write, with the code setup and some internet searching involved. I did use Prompt AI to generate some tables and code, which made things easy, but I had to think a bit on the scenarios and how I felt about them.

    All good things to showcase in the age of AI. If an AI generated code, could you determine the use? Knowing SIGN() can help. Write your own post and showcase your knowledge. Disclose if AI helps.

  • A Challenge of Our Knowledge

    AI is here to stay. It will evolve, it will get better at some things, and we might decide that it’s not good for certain tasks. It’s a weird, new, different technology that somehow seems magic, extremely intelligent, and at times as dumb as a box of rocks. It can do things that I could never do, or would never do, for myself. Heck, I’m not sure I could or would pay someone to do this by hand. Yet this was less than a minute for a computer system to take this image and transform it into something fun.

    Christian Buckley wrote an interesting post about AI challenging our identity, which sums up nicely one of the struggles many of us have with AI. Many of us identify with our work. We spend most of our lives for decades toiling away at a craft that we (hopefully) enjoy and in which we have success. We build skills, and we’re proud of our accomplishments.

    Some of us are more proud of our scars.

    Either is OK, but AI challenges that. AI can do work in seconds that we used to take minutes, often tens of minutes. Sometimes hours. It can remember things that we spend time googling or looking up in SQL Server Central forums. Our ability to search and navigate docs for an obscure setting, like that strange exit code you found in your CI/CD pipeline. We’re proud of where we’ve been and what we’ve done.

    I wrote recently about experts wanting to still solve problems themselves, without AI assistance. Some people don’t embrace AI because they think it devalues their knowledge. Others are afraid of the technology and potentially making mistakes with code an AI wrote that they don’t understand. They see this as a risk (and they should).

    However, choosing not to use the technology at all, or not trying to learn how and when to use it, is a mistake. We need to embrace the tools in our world, learning to take advantage of them.

    And more importantly, show our current and future employers we can do so.

    AI does challenge us. It challenges the way we used to work and some of the skills we used to rely on. We have to learn to flow with this challenge and make it a part of our future career.

    Steve Jones

    Listen to the podcast at Libsyn, Spotify, or iTunes.

    Note, podcasts are only available for a limited time online.