A Well Deserved Break

This is my last day of work. Not forever, just for six weeks. I’m off on my sabbatical after today and won’t be back until August 11. However, everything should run smoothly with Grant and Kellyn holding things down until I return. Have a little patience with them as this site can be a bit of a hectic whirlwind at times, and they still have other jobs to do.

It’s been a wild first half of the year. After very little travel in Jan/Feb, the rest of the year has been a bunch of travel, including most of May and June being on the road. With coaching responsibilities for two teams from Jan-Apr, I am ready for a break. No big plans, but I am looking forward to being at home, playing some guitar, working on a few projects while trying to be very unwired for six weeks.

I know most of us tech professionals likely deserve a break from work at some point. I am very lucky to get a sabbatical, on top of vacation allowances. It took my a number of years to understand and learn to relax while on breaks. Too many years of being on call, owning a business, and driving my career forward had me delaying or skipping vacations some years. I carried over a lot of days from year to year at many positions.

That’s a bad idea.

We need breaks. We need to recharge, and while I wasn’t thrilled when Redgate’s policy changed, I have come to appreciate it. We can only carry over a week, and I try not to do that in any year. They want employees to take breaks, and I try to do so. My wife certainly appreciates me getting away from work and not checking email, Slack, etc. I was nervous the first few times I left SQL Server Central for a week, often trying to get an hour of work to check on things every morning while on vacation. I come to trust that everyone at Redgate will keep an eye on things and ensure the site keeps running.

I may still blog about the sabbatical, but I don’t know it will be any sort of priority. I’ve been quite busy up until today and haven’t had time to plan much of anything. That won’t make for any interesting blogs, but it will be a well-deserved break.

Steve Jones

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

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

Posted in Editorial | Tagged | Comments Off on A Well Deserved Break

The Book of Redgate: Motivation

Another of our values is this:

Motivation isn’t about carrots and sticks.

Constant oversight and the threat of punishment are incompatible with great, fulfilling work. We believe in creating appropriate constraints and then giving people the freedom to excel.

We do have some rules, bumpers, guidelines, and limits on what people can do. We’ve added a few since 2010 as the company has grown and lots of people might not have the culture ingrained.

However, we try hard to let people get work done, expect them to do so, and have a few reminders, but without the thread of punishment.

At the same time our bonus or recognition strategies are mostly around group goals or company goals. We don’t push people to compete with each other to get a bigger bonus than someone else.

That was strange to me, coming from US companies, but I have found it more refreshing. There are some commission aspects for individuals, but for most of us outside of sales, we’re all in this together.

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.

Posted in Blog | Tagged , , | Comments Off on The Book of Redgate: Motivation

A Six Week Break

Today is my last day of work for six weeks. I start my sabbatical Monday, or maybe this afternoon, and will be gone. I may or may not blog, but I’m planning on being a bit unwired, so don’t expect anything. Certainly no technical posts.

I am mostly planning on taking a break from all my normal life, with no big plans. My wife and I are planning to get away for a few weeks, but beyond that I’m likely enjoying summer on the ranch without a schedule to follow.

Enjoy your summer and see you in August.

Posted in Blog | Tagged , | 2 Comments

Using a GenAI to Help Brent

Brent had a query exercise recently about train stations moving in some order and having overrides to this order in emergencies. I suppose he’s been traveling a lot lately and ran into an issue.

In any case, I decided to see if Claude could solve his challenge.

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

The Prompt

I put this into Claude, mostly copy/paste from Brent’s challenge.

I have a sql table of stations in a physical order. Here is the table and data for stations DROP TABLE IF EXISTS dbo.Stations; CREATE TABLE dbo.Stations     (StationId INT IDENTITY(1,1) PRIMARY KEY CLUSTERED,      StationName VARCHAR(50),      StationPhysicalOrder INT); INSERT INTO dbo.Stations (StationName, StationPhysicalOrder)     SELECT CHAR(64 + n), n     FROM (VALUES         (1),(2),(3),(4),(5),(6),(7),(8),(9),(10),(11),         (12),(13),(14),(15),(16),(17),(18),(19)     ) AS Numbers(n);

I also have an override table, which contains its own data for emergencies. Here is this code: Transact-SQL 1 2 3 4 5 6 7 8 DROP TABLE IF EXISTS dbo.StationRoutingOverride; CREATE TABLE dbo.StationRoutingOverride     (StationRoutingOverrideId INT IDENTITY(1,1) PRIMARY KEY CLUSTERED,      StationFromName VARCHAR(50),      StationToName VARCHAR(50)); INSERT INTO dbo.StationRoutingOverride (StationFromName, StationToName)     VALUES (‘E’, ‘S’), (‘B’, ‘I’), (‘I’, ‘D’);

write a query to return a result set that: * Starts with the station with the lowest StationPhysicalOrder * For each row, if there’s a row in StationRoutingOverride to dictate the next step, jump to that station * Otherwise, go to the station with the next StationPhysicalOrder

The Answer

Here’s the code:

WITH StationRouting AS (
     -- Base case: Start with the station having the lowest StationPhysicalOrder
     SELECT 
         s.StationId,
         s.StationName,
         s.StationPhysicalOrder,
         1 as StepNumber
     FROM dbo.Stations s
     WHERE s.StationPhysicalOrder = (SELECT MIN(StationPhysicalOrder) FROM dbo.Stations)
     
     UNION ALL
     
     -- Recursive case: Find the next station
     SELECT 
         next_station.StationId,
         next_station.StationName,
         next_station.StationPhysicalOrder,
         sr.StepNumber + 1
     FROM StationRouting sr
     CROSS APPLY (
         SELECT TOP 1
             s.StationId,
             s.StationName,
             s.StationPhysicalOrder
         FROM dbo.Stations s
         WHERE s.StationName = COALESCE(
             -- First priority: Check if there's an override for current station
             (SELECT sro.StationToName 
              FROM dbo.StationRoutingOverride sro 
              WHERE sro.StationFromName = sr.StationName),
             -- Second priority: Next station by physical order
             (SELECT TOP 1 s2.StationName 
              FROM dbo.Stations s2 
              WHERE s2.StationPhysicalOrder > sr.StationPhysicalOrder 
              ORDER BY s2.StationPhysicalOrder)
         )
     ) next_station
     WHERE next_station.StationName IS NOT NULL
)
SELECT 
     StepNumber,
     StationId,
     StationName,
     StationPhysicalOrder
FROM StationRouting
ORDER BY StepNumber;

That doesn’t work, so I added to the prompt:

2025-06_line0046

I got a similar error again with the group by in the CTE and pasted that in. The query got rewritten (Again) and this time it ran with this result, which matches Brent’s answer.

2025-06_line0047

GenAIs make mistakes, but they can also fix things. I wondered how well this would work, but it worked well. I merely told the model it had made an error and it tried again.

Imagine if the AI could connect to a db, run its code, and adjust from the error messages itself? The higher end coding tools are supposed to do this.

Posted in Blog | Tagged , , | Comments Off on Using a GenAI to Help Brent