Category: Blog

  • Don’t Fight with AI

    I was recently trying to handle a simple task with a few AI tools to see how well things worked. I realized that AI isn’t great for everything and there are times you need your judgment to stop fighting AI and use other tools.

    Tl;dr choose the shortest path and know your tools. In this case, just copy paste a script and results (see the bottom).

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

    The Scenario

    I have a table with some data. I wanted to duplicate this table DDL and DML for another system. Here’s my table:

    2026-07_0152

    Simple thing, right? Lots of possible ways to do this, but understand, this wasn’t the task. I was doing something else, with another goal.

    This task was just in my way.

    First Try – Prompt AI

    I use SQL Prompt all the time, so I thought, hey, AI, script this.

    2026-07_0135

    Well, not quite what I wanted. This works cross database, or if I make a new table name by editing the script in two places. But not ideal.

    2026-07_0136

    OK, I asked for the data, and this works. A bit. I only get 10 rows. To be fair, the original select I started with was top 10.

    2026-07_0142

    I then ask for the other data, and I go backwards. I don’t know why a model would go in this way. This reminds me of working with a junior person half listening to me.

    2026-07_0140

    Grrrr.

    Claude CoWork

    This seems like a cowork task. I’m not saying this is the best thing, and since I didn’t have a repo, I decided this over code. In any case, I asked for a task. Quickly Claude gave me options for 1) PoSh, 2)T-SQL, 3) something else. I picked 2 and it took about 4 minutes or so, but I got this script.

    2026-07_0146

    I had to open in VSCode, connect to SQL, and then it didn’t work:

    2026-07_0147

    Paste back into Claude, get a quick fix, maybe 15s.

    2026-07_0148

    Copy/paste the script, which runs. Certainly I could have put this back in SSMS, but I’m not sure that’s easier/harder.

    2026-07_0149

    I copy the results, which is fairly easy here.

    2026-07_0150

    I have the script I need and can move on:

    2026-07_0151

    Redgate Assistant

    We’ve added a new Redgate Assistant panel to SQL Prompt. I tried this next, and got a few results. The DDL was first, which I could copy/paste into my new query window.

    The second was a script I pasted in and ran, which gave me insert statements. Taking these results gives me about what I have above from the Claude script.

    2026-07_0145

    This was significantly faster. From prompt to result was in the 10s range and then I could get the results in a few more seconds. That’s quick, and I didn’t lose my thought context.

    The Best Way – SQL Prompt

    I’m experimenting with, and it’s been a tool I reach for often, but as I was annoyed by Claude taking so long, I realized the best way was actually this. Run the query in SQL Prompt that’s at the top. Then select all the data in the results by clicking the top left box and right click. Select “script as insert”.

    2026-07_0153

    I can then easily search/replace or edit the name of the table.

    2026-07_0154

    Doing this, once I thought about it, was about 5 seconds of effort, no context switch. Just grab this, change the name and go on with my other work on another connection.

    Use All the Tools

    I do think AI is a great tool for me. I also think it can cause me to spend more time and effort (and sometimes $$$) on simple tasks. While I’m all for experimenting, I also want to be efficient and effective.

    Fortunately, I’m somewhat paid to try different things and report on them.

    In this case, the KISS solution is best. Use Prompt what what it does best, work with your schema, code, and (lightly) data. I know I could use an MCP server, or Claude Code at al with more guidance, or something else, but those start to feel like using AI for the sake of AI and burning tokens when there are better tools.

    Not everything is better with AI. The people who succeed and prosper in this crazy AI world will embrace it when it’s most helpful and ignore it when it’s not very useful.

  • Architecting Zero Downtime Deployment Resources–Albany Day of Data

    Thanks to those who attended my session at Day of Data Albany 2026. I’m posting this to help you find the resources from the talk.

    Slides: ArchitectZeroDowntime_SQLSatAlbany2026

    GitHub Repo: https://github.com/way0utwest/ZeroDowntime

    The GitHub repo has the code for the database setup and demos (and teardown) in the SQL folder. This creates the db, login/user, schema, and data.

    The VS project is in the DBClient folder. I don’t think this is updated beyond .Net 4.6 (?), but feel free to update it. There isn’t anything special about this project. It was developer in VS 2019, but I ran it from VS2022 on Saturday, and I believe I upgraded my local project to .NET 4.8 last week. I haven’t committed this back as I don’t want to push this forward yet.

    If you have questions, feel free to contact me.

  • Car Update: August 2026

    It’s been some time since I provided a car update, so I decided to showcase a few things I’ve learned about my cars since the last one. In this post:

    • A Second EV: Lucid Gravity
    • Efficiency and Tires on the Tesla Model Y
    • Serendipity with a Suburban

    This is part of a series of thoughts on cars, just for fun. These are my thoughts and opinions based on my experiences.

    Our Second EV: Lucid Gravity

    We bought  a Lucid Gravity after driving it one day. We’d driven a few other EVs and then stopped by the Lucid dealer because we had an hour and it was close. We weren’t expecting to be impressed by the car, but we were. In fact, we immediately stopped thinking of the other cars.

    After a few hours of debating it, we bought one in the airport while waiting for a flight. It’s amazing to see how much easier it is to buy from Tesla and Lucid than other deals.

    It’s the nicest car I’ve ever owned, and it’s an EV with great acceleration and handling. It’s also got a squashed steering wheel, which I am surprised I like. It’s easy to control and has a nice space to rest my wrists.

    Lucid squashed steering wheel

    There are some weird things with software, and I have already learned how to “reset” the car. It took me a few minutes to get it right, which is weird. I have to press the brake and then press two buttons on the steering wheel. This didn’t fix the issue I was having with switching profiles, but it was an interesting experience to reboot the car.

    One of the things I love is the cooled and massaging seats. I might get tired of this over time, but I have a bunch of different settings and there are a few I’ve enjoyed on our drives.

    If you think about a Lucid, use my referral link. We’ll both get some credit.

    Efficiency and Tires on the Tesla Model Y

    In about 4 years of driving the Tesla Model Y, covering almost 60k miles, I had a long term efficiency of around 250Wh/mi. That’s just a bit below the rating for the car. I think I did very well, driving mostly at 45mph and lower in chill mode.

    A friend sold me the spare 18” wheels from his Model 3 when he got rid of his car. I put them on mine, mostly because he had better tread than my summer tires. I didn’t think much of this until I checked the efficiency one day.

    I was in the 205Wh/mi range with the smaller tires. Now, the software doesn’t have a setting for 18” tires on the MYLR, so I left it at the 19” stock tires, so possibly there is a calculation error, but I got > 10% efficiency improvement from changing wheels and tires. Smaller, lighter tires, but still. That’s crazy.

    As we looked for new cars, I was aiming for the smallest tires I could get, both for replacement cost and efficiency.

    Serendipity with a Suburban

    In 2006, I bought a 2001 Chevy Suburban for $6500. The car had 101,000 miles on it and we were slightly nervous, but with a family of 5, we wanted a car that would carry all of us skiing and on trips. The AC died the next year, but that car has served the family driving all over CO, WY, and NM for many years. Each of my kids had driven it, one even banged into a concrete barrier in the snow.

    I felt this was the best car investment we’d made over the years. I sold it in 2026 with 250,000 miles on it. We’ve basically done regular maintenance (oil, brakes, tires) and replaced minor parts across the roughly 150,000 miles we’ve owned it. The car was old, had rust on it, and in the hot CO summers, it was a car my wife used carrying the dogs from client to client.

    2001 Suburban in 2026

    She wanted something better.

    I had been periodically looking for a good deal when I stumbled on a 2010 Suburban with 203,000 miles on it, It was a 3 owner car, no accidents, lots of records of service.

    It was listed $6500 (I paid $6200).

    I made my wife cut short work one Sat and we drove down to a dealer, getting there just before they closed. A bit of a test drive and we bought it that night. So far, about 8k miles in, it’s performed as well as the old one.

    And it has AC.

    Still feels like a good deal and a good choice. 20 years later, same price.

     

     

  • TRY_PARSE Limitations: #SQLNewBlogger

    I got a notification from a question I’d posted at SQL Server Central: Getting the Average. A user had posted their repro didn’t work, with no real comment. As a SQLNewBlogger FYI, that type of post shows poor communication and a lack of communication. I see that a lot and it’s a challenge in the modern world.

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

    A Quick Setup

    This was what the user posted:

    declare @t table ( id int identity , i int ); insert @t select null; insert @t select 11; select avg(try_parse(i as int)) from @t group by id;

    This does return an error, as you can see below.

    2026-07_0373

    Why?

    Well, the TRY_PARSE() docs give part of an explanation. I highlighted this in Yellow, but the relevant text says “only for converting strings”.

    2026-07_0374

    Shouldn’t an int convert to a string? No, the precedence rules have int higher than char types. We convert lower to higher, not higher to lower.

    SQLNewBlogger

    I noticed something, thought for a second why this wouldn’t work, and then checked the docs. I decided to write this up and it was a 5-10 minute post for me. Easy to do and showcasing knowledge.

    It helps me remember, might teach someone something, and gives an interviewer something to ask me. Add to your blog with short posts like this (or drop on LinkedIn).