Category: Blog

  • Advice I Like: Ranch Rules

    Leave a gate behind you the way you first found it. – from Excellent Advice for Living

    This is a ranch rule. Leave something as you found it. If it’s wrong, then the person who left it that way is responsible.

    We’ve had people try to help by moving something or changing something. I’ve done it as well, and had it done to me. Most of us know gates are supposed to be closed (or left open) most of the time, but we sometimes change something for a reason. Out front gate is usually open, but if it’s closed, I know it’s likely because a horse is out. No one should go through and leave it open with the thought someone forgot.

    There are plenty of times when we might forget something, but our first instinct should be to put something back as we found it. Assume the last person had a reason for leaving it like that. If you have any doubts, go ask someone.

    A good rule at the ranch,and a good one at work.

    I’ve been posting New Words on Fridays from a book I was reading, however, a friend thought they were a little depressing. They should be as they are obscure sorrows. I like them because they make me think.

    To counter-balance those, I’m adding in thoughts on advice, mostly from Kevin Kelley’s book. You can read all these posts under the advice tag.

  • Deploying an Updated Model with SQL Compare 16

    In a previous post, I deployed a model to a database using SQL Compare 16. This used a new feature in that connects to Redgate Data Modeler. In this post, I want to update my model, and again use SQL Compare to just get the changes deployed.

    There’s a video of this post at the bottom if you’d rather watch me work.

    This is part of a series on Redgate Data Modeler. This is also part of a series of posts on SQL Compare.

    Updating the Model

    As with the last article, everything was in sync with SQL Compare. You can see this below.

    2025-12_0099

    Let’s alter a few things. First, I’ll add a new table. I wrote about this in another post, but I’ll click new table, click in the diagram and then fill in details. In this case, I’m creating the Organization table.

    2025-12_0101

    I’ll also alter an existing table. I’ll click the “Add column” in the lower right of the properties blade after selecting the table in the diagram.

    2025-12_0102

    I fill in some details here.

    2025-12_0103

    I’ve made my changes, so let’s now return to SQL Compare and click “Refresh” at the top. This re-runs the comparison and as you can see, I have some changes. My new table is listed at the top, and I’ve clicked on the altered table, UserAuthProvider. At the bottom, I can see the change in the diff view.

    2025-12_0105

    I’ll click “Deploy” just as I did previously and run the deployment. Once it complete, I can see the changes in my database.

    2025-12_0107

    Summary

    If there’s one thing I’ve learned in many years of work, it’s that I’ll make mistakes in my design and I need to change things. Hopefully I catch these mistakes in development, but even when I do, I need to update my dev database.

    This post showed how I can adjust my model, or someone else can, and I can then pull the new changes into my database with SQL Compare 16.

    SQL Compare is an amazing tool that millions of users have enjoyed for 25 years. If you’ve never tried it, give it an eval today and see what you think. Give Redgate Data Modeler a try and see if it helps you and your team get a handle on your database.

    Video Walkthrough

    Here’s a short video of this post.

  • Looking Back at the Redgate 2026 Company Kickoff

    Last week I spent a few days in Cambridge, UK for the Redgate Company Kickoff. I landed at 1130a Monday and flew away at 1215p Thursday. I wish I could say it was my shortest trip to the UK, but I think it’s the 4th or 5th shortest.

    2026-01_0251

    Almost the entire company converged in the UK for the event. We haven’t done this in the past, with separate kickoffs in different regions in the past. This time I saw friends and colleagues from Australia, the Netherlands, Germany, UK, the US, and likely somewhere else.

    In fact we split this into two days. Day 1 (shown above) was Sales and Marketing with Day 2 being the Engineering, Product, and other groups. I was only there for Day 1. Day 2 was at the Redgate office with some meetings and our marketing group getting together. Plus a few breaks.

    2026-01_0254

    Monday was a whirlwind, though we managed to get two Simple Talks podcasts recorded. Look for them coming soon. Tuesday was a very early start for someone that had been up Sat/Sun in Denver at 530a, and now needed a 600am GMT wakeup. It was very dark as we headed to Bletchley Park. I think I look way more tired than Pat.

    2026-01_0249

    The kickoff was great. It felt more organized, and we are looking to focus more on things that help our customers find success as well as finding the customers that we can help rather than every customer out there. I like that we constantly talk about helping our customers as we look to grow the company.

    I walked around, talking tech, business, life, and Redgate with colleagues a bit at our break and saw a bit of the museum, but honestly I couldn’t focus. I was too caught up in what we didn’t do well last year and where we’re going. I managed a couple shots in the museum (Bombe below), but gave up quickly and went to find other Redgaters to talk to.

    2026-01_0253

    I wasn’t sure if it was worth taking everyone to Bletchley, but as we talked about our plans and then things customers want, the theme made more sense. We certainly know security is important, and maybe becoming more important, to many customers. Interesting tie ins as a few of our upper management people had relatives or family friends who had worked there during WWII.

    2026-01_0252

    I was up to late on Tue and Wednesday. Tue with my warrior daughter who was spending two weeks touring universities in Europe. It was great to have her come through Cambridge and us catch up for a few hours.

    2026-01_0257

    Wednesday was talks from Marketing in our office. The whole group was there and I led an AMA with the Advocates on various topics. It was interesting and always informative as I only lightly know how marketing works.

    2026-01_0258

    Dinner was with our team and then a late night chatting over beers with various others. I finally made it up to my room only to get a message from my wife. I called her and she asked me why I was up so late. It was 2am!

    A short chat and then a very short night as I have a 7am car to the airport. Fortunately I managed to sleep on the plane.

    I wasn’t sure if it was a good idea to bring the whole company together (its’s $$$), but afterwards I think it was. I’m glad we did and I’m looking forward to 2026.

  • Using AI for Git Hooks

    Recently I had someone internally ask about whether SQL Source Control supports Git Hooks. Since it was after UK work hours, I decided to run a quick test. One problem, I haven’t setup a Git hook in a few years.

    Could AI help me? See what I did.

    This is part of a series of experiments with AI systems.

    Asking for Help

    Claude is my go-to AI. I don’t have a good reason why I don’t lean on Copilot or ChatGPT or anything else, but I’ve become more comfortable with how Claude works and responds to me. When I have something that doesn’t have any PII or other sensitive requests, I tend to start with the free Claude site.

    Here was my prompt: what is an example of a git precommit hook

    Simple, easy, no punctuation or big setup. I just needed something. I got some code:

    2026-01_0150

    and an explanation. Here’s the’s the text of the explanation (italics from me):

    This hook:

    1. Prevents commits with console.log statements

    2. Catches trailing whitespace

    3. Runs your linter

    To set it up, save this as .git/hooks/pre-commit and make it executable with chmod +x .git/hooks/pre-commit.

    If the hook exits with a non-zero status (like exit 1), the commit is aborted. You can bypass hooks temporarily with git commit --no-verify if needed.

    Many teams use tools like Husky to manage hooks in a project, making them easier to share across the team since .git/hooks isn’t version-controlled by default.

    This shows some bash, which I don’t think runs natively in Windows. That makes sense as a lot of coders are likely using Linux/MacOS for complex stuff and the default training for Claude likely assumes that. I asked about Windows and got two options: Node.js and Husky. Since I don’t like to install things, I went with Node. Here’s the next question I asked.

    2026-01_0151

    I didn’t want to lint or worry about whitespace, since I’m depending on SQL Source Control to create the files, so I asked a different question: can you create a pre-commit hook using node (for Windows) that checks for a commit message between 1 and 50 characters?

    The response is good. I didn’t want this, and reading this, I realize Claude is right. I wasn’t quite thinking through the process here. I also didn’t want the code for a commit-msg hook, so I ignored the code.

    2026-01_0152

    I could see that I was getting generic hooks, mostly for other code, so I rephrased a prompt: I want a sample pre-commit hook for .sql files to test something, what is a good example

    The response was a practical hook for SQL files. The code had a couple of messages printing our errors when I failed things, and the code here isn’t important, but here was the explanation. The bottom of the code is shown, and then the list of things that are checked.

    2026-01_0153

    At the top there is a comment about the hook, and since I’d done this a few years ago, I thought I know what to do, but I asked. I mean, why not ask the AI for more help? I liked that it noted not only do I need to add this to my .git folder, but I need to track this if I want to share it. That’s important. I do want other team member, or in this case, me on another machine, to have this hook.

    2026-01_0154

    Testing the Hook

    I then went to SQL Source Control and made a change. In this case, I added a file that I knew would fail the check. Here’s my code:

    ALTER PROCEDURE dbo.GetAllCustomers
    AS
    SELECT * FROM dbo.customer

    I could see this code change in the SQL Source Control GUI, but no error. I thought this might be staged, and I somewhat assumed the hook would fire on staging, so I asked.

    My new prompt: when does this hook fire?

    The response let me know that I had to commit this to get the hook to fire. It runs on the commit command, as before the commit succeeds. That’s good to know. Thanks, Claude, for helping me learn something.

    2026-01_0157

    In checking from the CLI, I realized that SQL Source Control at this point hasn’t staged the file. It also hasn’t written the file, so there’s nothing to stage. One of the downsides (one fo the few) of SQL Source Control is very limited git configuration. The write, stage, and commit happen at once.

    I tested this and sure enough, I got a failure when I tried to commit. The hook fired and saw my SELECT *, and my lack of a semi-colon.

    2026-01_0146

    I tested this further by fixing these elements individually, and I could correct the SELECT *, but I couldn’t fix the semi-colon. I realized with testing that when SQL Source Control writes the file, it always includes a “GO” at the end. So my hook doesn’t work.

    Asking for Modification

    I decided to see if Claude would fix this, as I wasn’t sure what to change myself. I’m not a Node nor RegEx person, and I’d be googling a bunch to figure this out (or find someone else’s code). Instead I tried this: can you adjust this hook to ignore the missing semi-colon if the file ends with a GO, or check for a semi-colon before the GO

    The response was interesting. The explanation said this:

    Now it handles both cases:

    • File ends with GO: Checks that the line before GO has a semicolon

    • File doesn’t end with GO: Checks that the last line has a semicolon

    The relevant code is here:

    2026-01_0158

    I can read this and it makes some sense, but I would have struggled a bit to get this done in a reasonable time. Instead, it was seconds for Claude to produce this.

    When I re-tested, this passed the SQL Source Control GUI and I had a working git hook looking for a couple of simple silly mistakes I might code.

    Summary

    This is an area that I have a little experience, but not a lot. I’m a junior dev when it comes to Git, and Claude is definitely more skilled. However, I have to know what to ask to get a result and I thought the answers and explanations were good in helping me setup this test in a few minutes rather than the better part of an hour (or longer) if I were searching and trying to assemble code.

    This is one of those areas where AI was very useful to me. It built a fairly trivial coding item I needed, it helped explain things when I had questions, and it was helpful in adjusting code quickly when I realized I needed something else.

    Imagine asking a colleague this, realizing you’d asked the wrong thing, and then asking them again for new code. How slow, and annoying, would this be for both of you? AI is a game changer here, for things that are too simple to work with a colleague on, yet complex enough that you’d waste a decent chunk of time googling.

    That time savings went into me testing the code and testing SQL Source Control. I verified that SQL Source Control can work with git hooks in minutes.