Author: way0utwest

  • Collecting Data is Hard

    Data is the lifeblood of much of the world today. Not necessarily big data, and certainly not perfect data, and definitely not just digital data. Organizations, individuals, governments, really everyone out there are making decisions based on data. You might think it’s going to rain, so you cut the grass today, or maybe defer adding fertilizer. Your organization sees demand for a product increase, so it orders more and produces more. Government is always using data to make decisions about resource allocation. We might not think governments make great decisions, but they do use data and data matters.

    Recently I was reading a science fiction book (I, Starship) about the future, where a person’s brain (Henry) becomes uploaded to manage a starship. This ship will travel light years away for 80 years and they need the human crew asleep in hibernation to survive the journey. The interesting thing, to me, was a part in the book where there is a discussion of why Henry was uploaded and why AIs aren’t advanced enough to run the starship. There’s this quote: “The first generations (of LLMs) performed well, but as time went on, we entered a situation where more and more of the data available to train them on was itself machine-generated. So, instead of mimicking high-quality human output, the outputs got more garbled.”

    I worry about this as the current models are sucking up so much data to learn, but so little of the new data is being generated by humans. We already see plenty of AI-slop on the Internet, with fewer and fewer articles, blogs, etc. being human generated. I’m sad because people don’t share as much of their own thoughts, knowledge, etc. This is especially true in light of the AI companies taking individuals’ work for training without compensation. Indeed, I worry that many places will go the route of Stack Overflow, where they essentially fail.

    I’m worried about that here at SQL Server Central, as I see less questions being asked by humans and less discussion about the nuances of database challenges.

    However, there are AIs out there also polluting the world. This was a piece from last year that more AIs are taking surveys and polls. Reddit is seeing questions being asked, and I’m sure there are AIs answering them. How long before the amount of AI generated traffic dwarfs human generated traffic? I mean new data, not consumption. I expect plenty of humans are going the way of the people in WALL-E and just consuming data. They’ll continue to watch untold numbers of reels, shorts, Tik-Toks, etc.

    Are we going to see less “real” data and more generated data? I already have seen no shortage of issues from customers trying to use synthetic data for testing. It doesn’t match the real world well, but if they stop getting real data from customers and more from other bots, maybe it won’t matter. Of course, I’m not sure how well their systems will perform in the real world.

    GIGO is a real issue, and I expect a lot of companies will learn this as the volume of AI-generated data increases.

    Steve Jones

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

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

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