Finding the Next Sequence Value: #SQLNewBlogger

I saw a question asking about the next sequence value and decided to try and answer it myself. I assumed this would be easy, and it was, but I used some AI help to make it very quick to get the value and learn something.

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

Checking for Sequences

I know I’ve done some testing lately with sequences for a customer, so I decided to ask Prompt AI to help. I connected to a database and asked this question after clicking ALT+Z.

2026-03_0133

I got this response, which I executed before accepting the code. One thing I like about SQL Prompt is I can execute code and then adjust my prompt (or paste in an error). As you can see, I have 3 sequences in this database. I get a bunch of the meta data, including the current_value.

2026-03_0134

However, is that the next value or the last one? It could be interpreted multiple ways. I could look this up, but I decided to ask again. I accepted the code, then wrote a quick SQL statement to get the next value. If you’ve never done this, you might not know how sequences work, which is a different issue. In my case, a “se” tab, “ne” tab “i” got e this code. I then asked to find this.

2026-03_0136

SQL Prompt AI returned this query, which gets me the current_value, but I know that. I decided to ask for an explanation rather than Google or work my way through MSLearn.

2026-03_0137

The explanation is good. It’s not the current value + 1 it’s the current value + increment, which is a subtlety that some people might miss.

2026-03_0138

Let’s test this. I wrote some code and then executed it. I get 17, which makes sense. The current value (seen above) is 15 and the increment is 2.

2026-03_0139

Problem solved. This short session likely will help me remember this detail for future code (or prompts).

SQL New Blogger

This post took me about 8 minutes to setup the code, capture the images, and write this up. I’ve done a lot of these, but I showed how to investigate a question, use AI for help, and then make sure the AI is actually giving me something good.

You could write these types of posts and show your fluency with both data engineering and AI assistance. Take a minute and start writing some blogs that showcase how your skills and career are growing.

Posted in Blog | Tagged , , | Leave a comment

Is Your Time "Free"?

We do a lot of research at Redgate Software, often contacting customers or Ambassadors and asking questions, getting feedback, and listening to their challenges or criticisms. We take that information and it helps guide us when we build the tools that help you in your job.

Recently, I watched a call with a customer who uses our famous Toolbelt in their job and has for years. In this case, the call was about the value of Flyway and how that might fit in their organization. The person performed a lot of manual work to deploy code changes, and could see the way in which Flyway helps, but wasn’t interested in saving time.

They saw their time as free. I assume their employer felt that way as well.

In my three decades of working in technology, I’ve seen a lot of employees and their management think of their time as free. Management has been happy to have tech workers stay longer at their desk to get things done. How many of you have had to deploy code on nights or weekends?

Perhaps a better question is how many of you have been happy to work nights or weekends? I’ve seen no shortage of IT people volunteer their efforts to work longer or out of hours to get something done. It’s a point of pride or a badge of honor to spend lots of hours working. I know I’ve felt that way in the past. I’m both proud of working 100 hours a week to support a system (for multiple weeks) and saddened that I did that.

I did learn that wanting to overwork myself was a poor idea after spending a year with a blanket and pillow in my desk. I worked overnight or late into the night too many times across a year and eventually decided to look for a new job when I realized that neither my employer nor I was valuing my time.

Many tech people are on salary, which makes it very easy for management to request (or demand) extra hours spent to meet a deadline or minimize the impact on other users who work “normal” hours. This happens to other professionals (doctors, lawyers, etc.), but I’m not sure that’s a good thing.

Working long hours, especially during stressful situations, can teach you a lot. It’s an opportunity to grow and improve your career, but it has lots of downsides. Burnout, mistakes, unhappiness and other negative factors can impact your life and work over time. You ought to value your time, and your employer ought to as well. I learned this when a coworker told our boss he was working the problem until 5 and then needed to leave for a family event. He could work later or come in early the next day, but not everyone needed to stay all evening tonight, and he wasn’t going to do so.

Learn to be more efficient, whether that’s in the work you do, or the people you manage. Learning to save time, use tools, share knowledge, and smooth your processes will build a stronger team over time. People will be more focused, more knowledgeable, and able to get more done in less time.

Invest in things that save time. It’s the one resource we can’t get more of, no matter how much we push on people.

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 | Leave a comment

The Book of Redgate: No Politics

In today’s world, this might mean something different, but in 2010, we had this value:

2026-02_0176

In our context, this was about being open and transparent. This is the text from the facing page:

No gossiping, no intrigue, no pussy-footing around problems and no telling people what you think they want to hear whist privately disagreeing. We will be transparent in our dealings.

In a small company (2010 must have been 200-ish people), this made a lot of sense and I think overall we minimized politics. I don’t know this will ever be a “no politics” world for Redgate or any other, but we were better about publicly disagreeing.

I think we’ve lost a little of this over the years, as I see more people talking a bit inconsistently to smaller, private groups than they do to large ones. I try hard not to do this, though I’m sure my open-ness sometimes rubs people the wrong way.

I’m OK with some conflict. I’m also OK debating and disagreeing about what we do or why/how we do things. I think it’s healthy to do so.

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 , , | 3 Comments

Doing the Little Things

I wrote a blog about sitting at LHR recently and watching planes take off. That’s been a fun thing for me to do when I’m stuck at the airport. I can see a plane roll down the runway every 35-45s during busy times. This time I was sitting by a window in the hotel, working and watching.

There was a moment when I realized no planes were taking off. I looked and saw a vehicle rolling down the runway, and then realized there were two, one from each direction. It was an runway FOD inspection, looking for anything that might damage a plane.

It’s a little thing that has to be done regularly at an airport.

How many of you do little things in your job? Do you clean up old logs/backups/ETL source files? Do you double-check security for old/expired accounts, unused databases, forgotten audits/traces, etc.? Maybe do you check the status of patches across your database estate? Is there something else you should do semi-regularly?

I’ve seen many people (including myself) lose track of things over time because there are so many. My phone (or pager) has rung so many times because a system ran out of disk space due to old files that accumulated over time. Those log files might not be be large, but after years the size can add up. And they’ll fill up a disk at night, not during working hours.

This is where AI might help. I’ve written many little scripts that helped me clean things, but they were often brittle and focused on a specific task. Generalizing them would take too much effort, and might not even be possible. After all, sometimes I’m not even sure what the general case would be when building the utility.

AI coding agents can help us in this space. Ask an AI for a script to remove old backup files, leaving the last few. Perhaps you want to look for unused accounts. You can ask an AI to setup an audit to scan for login times (script one) and then process the results to get the last login time for each account (script two). The action might be to disable accounts that haven’t logged in for six months (script three). Set these scripts to run ad hoc or on a schedule as needed. Just be sure you have a calendar entry to remind you to check the results.

Each of these scripts isn’t that complex, but across many systems, perhaps with slightly different requirements and situations, you might not have time to adjust each script or even build them. However, if you can think about a small utility, an AI can help you build it. Just be sure you also ask the AI to set up tests to ensure the script works as intended. This is especially important since you’ll likely be asking the AI to refactor or change the code and want to prevent regression bugs.

Doing the little things at work can eat up a lot of time, but building small utilities can help you can ensure that your systems run smoothly. And ensure you still get home in time for dinner.

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 | Leave a comment