Category: Blog

  • A Small LLM Fail

    Another test with Copilot in SSMS (v22 P3) that didn’t go so well. This one surprised me.

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

    Looking for Known Data with Copilot

    One of the things I wanted to do recently was do some checkdb checking of a system. As a result, I was looking for the last time this was run on a database. I decided to ask Copilot.

    2025-10_0169

    This made perfect sense, as this was a new restore, and I hadn’t run it. So I asked for the query.

    2025-10_0170

    This doesn’t work, but I’ve gotten used to pasting in errors and letting the LLM sort this out. So I did this.

    2025-10_0177

    OK better, but this still doesn’t work.

    2025-10_0178

    I apply this and run it, and it works, but doesn’t return data. I wouldn’t expect this to for this database, so I try to clue in the AI.

    2025-10_0179

    Seems wrong. On this page, DatabasePropertyEX, I see this:

    2025-10_0180

    Not sure why this doesn’t work well. I don’t see a way to change the model, so I’m not sure what’s being used or when it was trained, but I’d expect it to know what is in DatabasePropertyEX().

    Prompt AI

    Prompt AI was a little better, though not at first. I asked the question:

    2025-10_0181

    I got this:

    2025-10_0183

    I can’t select this code (submitted a bug), but this isn’t bad. The result of my next query failed as well.

    2025-10_0184

    At least I had a clue what to do. I started then with this:

    2025-10_0185

    I got the “with TableResults” added. I then asked it to modify this to find the last time DBCC CHECKDB ran. I got this:

    2025-10_0187

    Summary

    To be fair I futzed with both of these a few times. An LLM isn’t deterministic, so I got different results, but I never got the correct result from Copilot. I did get this from PromptAI at one point, which does work.

    2025-10_0188

    GenAI’s are funny beasts. You definitely need to spend some time learning how to use them.

  • T-SQL Tuesday #191 Round Up

    I hosted this month, late as it turns out, but we still had a few entries. Here’s a look at the blogs people published.

    First as always, Rob Farley writes about the complexity of string parsing, using TVFs. He also shows some of the performance implications of complex parsing. Thanks to Rob for reminding me to get the invite out.

    Louis Davidson wrote about parsing HTML, which is definitely a challenge in T-SQL given the nature of the language and how embedded different tags can be. I’ve done this a little, and I prefer using Python to do this Winking smile

    Courtney Woolum writes about working with the IMDB database and needing to parse comma separated data with STRING_SPLIT and APPLY.

    Lucas Kartawidjaja brings us a look at a data outside SQL Server using the Log Parser, a free CLI tool from Microsoft that works well with data outside of SQL Server.

    Andy Brownsword tries out the new RegEx functions in SQL Server 2025.

    Hugo Kornelis hates intelligent keys because they store different types of data in the same column. He also shows some PARSENAME and CHARINDEX tricks.

  • SQL Clone at Scale with Striped Backups

    I had a customer recently reach out to ask if SQL Clone would work with 20 backup files. I decided to test this.

    This is part of a series of posts on SQL Clone, which is a virtualization product from Redgate Software.

    The Scenario

    A customer asked about SQL Clone working with a lot of backup files (striped), like 20. Our support org said this should work and handle the max number of files, which is 64 for the backup command.

    I know SQL Clone works with striped backups because I wrote an article on it, but I only tested 7 files. How to test more than that?

    First, get the backups. To do this, I used a GenAI to quickly get me a command. Once I had this, I ran it and got a lot of files.

    2025-10_0155

    Now to get the SQL Clone image.

    Image Creation

    I decided to start with the GUI. This has changed since I wrote the article in that it now puts each file in a separate text box. By default you get two. I pasted in my file path and file, and then copy/pasted in the 2nd box. I continued adding them, clicking the “Add another file” at the bottom each time (see the image).

    2025-10_0157

    It was tedious, but it was a quick way of testing this. I likely would have taken longer than the 3-4 minutes of copy/pasting to write a PoSh script (though I need to do that). You can see most of my files below.

    2025-10_0156

    Once I had 32 of them, I clicked “Continue” and entered the name and location for my image. Then clicked “Create”.

    It worked. The image shows my SQL Clone image being created successfully and a clone from this image.

    2025-10_0158

    These were small files, so the restore time was quick. Each is about 3MB, so we’re not looking at much.

    Summary

    This shows that SQL Clone can work with 32 files. I assume it works with 64, but that will have to wait until I have time to mess around with the PoSh to make the image command creation easy.

    If you are looking to save storage space for multiple copies of databases, or give each user a consistent copy in seconds, check out SQL Clone.

    Video Walkthrough

    See this article in video below.

  • Advice I Like: Training Employees

    Train employees well enough that they could get another job but treat them well enough that they never want to. – from Excellent Advice for Living

    This one is close to my heart. I firmly believe that you need to find good employees and invest in them. Employees can make a big difference in how well you succeed as well as how efficiently you can run an organization. If you trust employees, you can get a lot done, but takes work.

    There’s an old joke that expresses a similar sentiment. Here it is as a quote attributed to Peter Drucker, a well known management consultant.

    2025-10_0146

    Perhaps one of the best reasons to train people is time. Time is a valuable resource, and the more it’s wasted, the less you get done, the less competitive you are, and the less your employers earn their pay.

    Train them and benefit more.

    If you worry about training those that might not be worth investing in, that’s hard to know. Train everyone, but hold them accountable to use that training and improve. If not, cut them loose and move on.

    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.