Category: Blog

  • 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

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

  • Monday Monitor Tips: Configuring Access to the MCP Server

    I have been experimenting with MCP servers in a few ways, including the Redgate Monitor MCP Server. It took me a few tries, and some help from engineers to get connected. I’ll cover how I did this in Claude and Visual Studio Code in this post, and try to warn you about a few places I made mistakes.

    This is part of a series of posts on Redgate Monitor. Click to see the other posts.

    Creating A Token

    I’m not going to bore you with the setup and configuration of the Redgate Monitor instance. That procedure might change by release, so I’ll assume you’ve got the MCP server enabled.

    To access the MCP server, you need to give your AI agent a token. This authorizes the MCP server to connect to Redgate Monitor and read data. These are read only tokens, and designed for the MCP and the tools that are available.

    In the configuration, there is an Access Tokens area. Click here.

    2026-08_0225

    Click Create Token on the next screen. This is in the upper right.

    2026-08_0226

    On the next screen, give your token a name, description, and set an expiration date. The default is one year.

    Make sure you select the MCP type. I messed this up the first time.

    Below this, pick the servers the MCP token can access. I’ve selected just the Production serer group, but you can set this as needed. I’d make sure the name and/or description lets you know what can be accessed.

    2026-08_0227

    You will get a review screen, to verify what you’ve done. Accept that and you’ll get a dialog with the token value. Make sure you save this securely somewhere.

    2026-08_0228

    Once you’ve created this, it’s in a list, and you can click the “view details, which shows you what the token can access, as you can see below. You cannot get the token itself anymore.

    2026-08_0229

    Configuring VS Code

    I’m going to show this working in VS Code. I opened the Command Palette and selected the MCP: Open User Configuration, as shown.

    2026-08_0230

    Inside the config, I pasted this inside the “servers” key. This should be a sub element, and this goes alongside any other MCP servers.:

    "redgate-monitor": {
    "type": "http",
    "url": "https://<your-monitor-host>/mcp",
    "headers": {
    "Authorization": "Bearer ${input:redgate-mcp-token}"
    }
    }

    Then inside the “inputs” key, add this:

    {
    "id": "redgate-mcp-token",
    "type": "promptString",
    "description": "Redgate Monitor MCP token",
    "password": true
    }

    The save this. When you start the MCP server, it will ask you for your token. Paste the value in and then you should connect. You do this from the MCP: List Servers item in the command palette. This should give you output like this, with a connection message and tools discovered:

    2026-08_0231

    If I open a chat, and add the MCP as a tool, I can ask questions. Here’s a question I asked and the initial responses from the LLM.

     2026-08_0232

    Once this is done, I’ll get a list of the alerts. I did approve some PoSh commands where the LLM stored results from Redgate monitor and then tried to process those after writing them to a temp file.

    2026-08_0233\

    This is the raw LLM trying to use tools and fumbling around. With a few skills and guidance, this will run smoother, quicker, and more efficiently in your environment.

    Summary

    The Redgate Monitor MCP server is a great way to start using AI to analyze all the data in your database estate that Redgate Monitor collects. There were 7 tools when I started, but within a few weeks there were 11. By the time you read this, there are likely going to be even more.

    Give Redgate Monitor a try and learn how to use MCP servers to link your LLM to Redgate Monitor and start analyzing systems in a more natural manner.

    Redgate Monitor is a world-class monitoring solution for your database estate. Download a trial today and see how it can help you manage your estate more efficiently.

  • The Book of Redgate: Evidence

    We aren’t the only company that does this, but Redgate Software does try to be data driven. Across my 18 years, I’ve had plenty of people use evidence from customers, from usage data, from market research, and more to justify a decision.

    I think Google and quite a few other companies have called this being “data-driven.”

    2026-06_0203

    The text on the next page continues the sentence:

    not on people’s opinions, the volume of their voices or who they are. When the evidence changes, we are prepared to change our minds. We will thank, and never shoot, the messenger.

    I will say that this has skewed a bit over time, as I find that evidence is subject to interpretation and I’ve certainly seen some people cherry picking evidence to support their decision. Sometimes by asking for certain evidence.

    However, we did realize there were issues and have tried to correct. I was part of a yearlong project last year that impacted marketing, product, and engineering where we focused on getting more information from more customers, and especially being careful to get evidence from multiple sources, including different geographies. We had a bias to the UK, so we tried to correct for that, and I think we made some strides.

    That being said, I haven’t seen us shoot or blame the messenger for bad news, though sometimes thanks are sometimes not as sincere as they could be. I understand, because contrary news tends to dampen enthusiasm.

    I have a copy of the Book of Redgate from 2010. This was a book we produced internally about the company after 10 years in existence. At that time, I’d been there for about 3 years, and it was interesting to learn a some things about the company. This series of posts looks back at the Book of Redgate 15 years later.