Category: Blog

  • Flyway Tips: AI Deployment Script Descriptions

    With the AI push being everywhere, Redgate is no exception. We’ve been getting requests, demands, suggestions, and more about how to add AI into our products and help developers and DBAs be more productive.

    One of the areas we’ve started to add some AI is in Flyway Desktop (FWD), with a few features designed to help reduce the cognitive load and context switches needed while developing code, and help users better understand what changes they’re making in their systems. This post looks at one of those changes, which is in preview (as of Jan, 2026).

    I’ve been working with Flyway and Flyway Desktop for work more and more as we transition from older SSMS plugins to the standalone tool. This series looks at some tips I’ve gotten along the way.

    Understanding Deployment Scripts

    In Flyway, we call the deployment scripts “migration scripts”, but they are the same thing. These are scripts that are changing, altering, or evolving our database schema in some way. New or altered objects, various schema items, and more.

    When a developer creates a migration script, they often do this close to the time they are making the changes in development. Not always, but I find a lot of customers change something, test it, and then make the migration script. Guidance for a lot of customers is to keep the migration scripts simple and easy. For example, here’s one I have that creates a simple table. If you look in the image on v23, which says “Create Product Table” in the description, that is what it does.

    2026-01_0161

    If I click on this line, I see the script shown below the name (V23__Create Product Table.sql). The new thing just below in this image is that an AI summary is being generated.

    2026-01_0162

    In a few seconds, this changes. I get the summary of the table. In this case, it says I have a new table with some columns.

    2026-01_0163

    If I expand this with the drop-down on the right, I see the full summary. This includes telling me a PK is being created, which is good info. I could look through the code, but the settings, the PRINT statements and more make this harder than it should be.

    2026-01_0170

    What about a more complex script? If I pick a different one, such as V24__Removed Territories and Region tables and related constraints and procedures, I get an OK description that lets me know a few things are being changed. I wish this had a little more detail in it, such as the tables on which FKs are being dropped, and maybe a list.

    2026-01_0164

    Let me create a whole new set of objects. In this case, I’ve added some discount features in a bunch of tables. Here is the list of objects I added to the migration script.

    2026-01_0168

    When I generate the migration script and then click on it in the Migration Scripts tab, I see this description.

    2026-01_0169

    That’s an interesting description, as I see that there are territory and customer tables, which I’d forgotten I added. I was working on them and added them, but hadn’t committed them. I added the discount stuff (3 tables and a view) in a dev session today, and then selected everything to save and include in a migration script.

    This is one of those areas where the summary helps me remember what’s in here, and in this case, I’d want to delete this script and re-generate it with a different set of object changes. Then a second migration script with other changes.

    Enabling AI Features in Flyway

    This is a preview feature as of Jan 5, 2026 as I write this. To get this in your FWD, your organization needs to have enabled AI features in your portal. I’m just a member, but whoever is an admin for your Redgate products would find it here.

    2026-01_0173

    In FWD, you need to look at the Preview Features item under the config menu.

    2026-01_0171

    In this area, you can enable or disable features as needed. I see these marked as Red-gate only, but I think they are supposed to be released to some customers by this time. It’s likely I need to upgrade my FWD, which I’ll do when I have time.

    2026-01_0172

    Once you do this, you should start seeing some AI stuff with the purple/pink shaded area and the sparkle icon that we’re all seeing everywhere.

    2026-01_0174

    Summary

    This post shows one of the Flyway AI features that we’re adding to help you deal with the chaos and complexity of database development in your environment. This features tries to summarize the details in your migration script and provide you a summary.

    This isn’t perfect, but as you look at scripts, it fairly quickly gives you a look at what’s included without you having to read all the code. You should double check the code and be sure it’s what you expect, but if you’re looking through a few scripts for a particular change or impact, this might help save you time.

    There is a limit to the amount of stuff we send to the LLM to summarize. I can’t remember (or find) the limit, but very large scripts aren’t summarized, and you’ll see a message to that effect.

    This feature is documented, but we are likely to enhance and change it a bit, so all feedback is welcome. If your organization doesn’t want you using AI, and you could share some schema from a migration script, I’d be happy to test it for you and see what summary is produced and send it back to you. Ping me on X/LinkedIn/BlueSky if you want.

    Flyway is an incredible way of deploying changes from one database to another, and now includes both migration-based and state-based deployments. You get the flexibility you need to control database changes in your environment. If you’ve never used it, give it a try today. It works for SQL Server, Oracle, PostgreSQL and nearly 50 other platforms.

    Video Walkthrough

    See a video of me looking at this feature below.

  • A New Word: Fawtle

    fawtle – n. a weird little flaw built into your partner that somehow only endears them more to you, in the way that impurities dissolved in water are what allow it to conduct electricity – if all the imperfections were removed, there would be no spark.

    I won’t give you a specific, as it’s not really something I’d share, but my wife has a quirk that used to really annoy me. In some sense, it was a thing that I think I tried to avoid in myself.

    However.

    Over time, I realize this is a part of who she is. She knows it, the kids know it, I know it and not only accept it, but I can smile to myself a little and appreciate why the thing makes her unique and wonderful.

    The more you find fawtle in others, the more you enjoy their differences from you and others.

    From the Dictionary of Obscure Sorrows

  • Another Change

    Today Redgate announced that we are partnering with Bregal Sagemount, a growth-focused private equity firm. There are no details of terms, and you can read the press release. It’s an opportunity for us to use this investment to drive growth forward in our products and solutions in the future.

    I’ve been with Redgate since 2006, when they acquired SQL Server Central. At the time, a lot of people expressed concerns and worry about the acquisition. We announced it at the PASS Summit to a very mixed reaction from people who used the site. I tried to reassure people as best I could, noting that Redgate hadn’t expressed any plans to make major changes other than reduce external advertising.

    They didn’t, and I’ve continued to run SQL Server Central for the last 18 years as a part of Redgate. While my job has changed in many ways, that has remained consistent, and I think we’ve delivered on helping the community learn, ask and answer questions, becoming better data professionals along the way.

    The same types of assurances I gave are being given from various leaders at Redgate now, and I am taking them at face value. I know the founders of Redgate want to company to succeed and the fact that they didn’t sell outright is encouraging.

    That being said, I’m nervous. I’ve been a part of restructurings, investments, sales, and more in the past, with mixed success. Whenever the foundations shift, I usually start looking for a new position. I’m not doing that today, but I am nervous because I don’t like big change.

    I am hopeful this will mean that Redgate can tackle a few things that we’ve struggled to do and that we’ll invest in growing our company in ways that we struggled to do in the last decade. One of my hopes (selfishly)  is an investment in SQL Server Central, which has languished a bit the last few years. We made a platform change in 2019 (not my choice) and we’ve had some lingering issues since then. Most things work, but some don’t work well. Some are broken, and there are lingering issues that are either annoying or I’d like to change.

    I also think this investment may help spur some changes in products and solutions that help customers solve more database issues. We are a for-profit company and revenue will certainly matter, but more investment in staff is always needed and wanted. If there’s one thing I’ve seen in the last 18 years is that there is always a backlog of things to work on, and I’m hopeful we’ll be able to not only tackle some of those things, but continue to deliver more value every week.

    I’m optimistic about the future at Redgate, and nervous, all at the same time, but for now, I’m not looking to make a change.

  • Using Prompt AI to Help Setup Data Analysis

    I used Claude to build an application that loaded data for me. However, there were a few others things I needed done to help me get the data ready for analysis. I could have used Claude (or another human), but this was a place I’d need to do a lot of directing.

    I did, however, use Prompt AI to help me get this moving quicker and start some analysis. This post covers the way I got assistance inside SSMS from Prompt AI.

    This is part of a series of posts on SQL Prompt. You can see all my posts on SQL Prompt under that tag. This is part of a series of experiments with AI systems.

    Adding New Structures

    As a part of my data analysis, I needed to tag sessions with topics. This wasn’t really done as a part of most SQL Saturday events. While there might be tracks, often the sessions aren’t categorized with tags. It’s a pain, most organizers and most speakers don’t want to bother.

    Plus, search works well on a website. For data analysis, not so much.

    I decided to use Prompt AI to help a bit at this point, since I was low on credits.
    I asked it to add a structure. Possibly I could have written the code in not much more time than it took for this prompt, but here I get to let an assistant take a stab and then critique the work. Here’s my prompt to SQL Prompt AI:

    2025-12_0118

    Here are the results. This has the PKs, FKs, and indexes, some of which I might have forgotten. I don’t love names like “description”, but that’s fine. I could easily fix that.

    -- Create a table to store tags
    CREATE TABLE dbo.Tags
    (
        TagID INT IDENTITY(1, 1) PRIMARY KEY,
        TagName NVARCHAR(100) NOT NULL,
        Description NVARCHAR(500) NULL,
        CreatedDate DATETIME
            DEFAULT GETDATE()
    );
    
    -- Create a junction table to link sessions with tags (many-to-many relationship)
    CREATE TABLE dbo.SessionTags
    (
        SessionID INT NOT NULL,
        TagID INT NOT NULL,
        PRIMARY KEY (
                        SessionID,
                        TagID
                    ),
        CONSTRAINT FK_SessionTags_Sessions
            FOREIGN KEY (SessionID)
            REFERENCES dbo.Sessions (SessionID),
        CONSTRAINT FK_SessionTags_Tags
            FOREIGN KEY (TagID)
            REFERENCES dbo.Tags (TagID)
    );
    
    -- Create index to improve query performance
    CREATE INDEX IX_SessionTags_TagID ON dbo.SessionTags (TagID);
    CREATE INDEX IX_SessionTags_SessionID ON dbo.SessionTags (SessionID);
    

    Now, I need to analyze the data.

    Fortunately, Prompt AI helped me. Below this DDL, was a snippet to test my tags. I had this code listed:

    SELECT 
         s.SessionID, 
         s.Title, 
         STRING_AGG(t.TagName, ', ') AS Tags
    FROM 
         dbo.Sessions s
    LEFT JOIN 
         dbo.SessionTags st ON s.SessionID = st.SessionID
    LEFT JOIN 
         dbo.Tags t ON st.TagID = t.TagID
    --WHERE Title LIKE '%n rds%'
    GROUP BY 
         s.SessionID, s.Title;

    I used this to check my tags, which were non existent at this point, so I had all NULL values in the Tags column. Fortunately, I know how to write some code, so in another window I wrote this code, which inserts data, but doesn’t create dups since I might have dups based on my LIKE clause catching the same session twice.

    I also get the list of current tags, so I could change the number used in the insert as needed. There are more elegant ways to do this, but I wanted to get something done.

    INSERT dbo.SessionTags
    (
         SessionID,
         TagID
    )
    SELECT SessionID, 10
    FROM sessions WHERE Title LIKE '%n rds%'
       AND sessionid NOT IN (SELECT sessionid 
            FROM dbo.SessionTags 
         WHERE TagID = 10)

    SELECT @@rowcount
    GO
    SELECT top 30
    *
    FROM dbo.Tags

    
    

    There was a sample INSERT statement for tags as well, so I modified it to use tags I cared about. Then I started running my test query to look for NULL values and start filling them in.

    Here’s a look at a run. I’ve added some tags, but there are some nulls. There are also multiple tags for some sessions. I added the description field as well, but for most of the data, this doesn’t exist, so I don’t have it. Yet. That’s another project.

    2026-01_0130

    Line 63 is for Snowflake, which isn’t a tag. So I edit my commented out code to include Snowflake and then execute it. This is commented, so as I hit execute it doesn’t run automatically.

    2026-01_0131

    Now I get a list of tags and use that to edit my numbers in the SessionTags insert statement. In this case, Snowflake is number 17, so I change the insert to that, and edit the LIKE statement. This will add that tag to all sessions with Snowflake in the title.

    2026-01_0132

    I repeated this for a number of sessions. Below, I’ve re-run my tag query and now we see Snowflake is added.

    2026-01_0133

    Why I Didn’t Use an AI for This

    I built an application that loaded this data with Claude Code. I could have asked Claude to add the tags as well, but I didn’t have any data to put in there. I wasn’t even sure what I would do, especially as a lot of these sessions aren’t really sessions. Notice the timings above, the breaks, the panels, etc. There are also lunch breaks and other items that aren’t really sessions.

    Claude could have cleaned this data. However, I want to be sure of what I’m removing. Having Claude write the delete (or run a select first) and then ask me what to do doesn’t seem to be a good use of its cost or my time.

    I still need to be the human in the loop. There were some times I ran a select for certain words and then check the list before adding the tags. For example, here was what I did for Snowflake.

    2026-01_0134

    All those are good, but when I ran a search for Agent, I found mostly AI based results, but a few were SQL Agent sessions. Tagging those as AI wouldn’t make sense, so I had to find a better way to update the data I needed updating.

    Summary

    SQL Prompt didn’t do a lot here, but it did quickly get me moving on the task I was focused on rather than the details to support it. I could have written the DDL, but it would have taken focus away from me in thinking about tags. This did as good a job as I could do, or more importantly, as good a job as I needed.

    It also gave me a query and insert statement to get moving, again, reducing my mental load. I could have written that query, but I would have spent a few minutes doing it rather than thinking about how to assign tags.

    Ultimately I think this was a good use of AI, saving my time and energy, allowing me to focus on the task I was trying to accomplish without distraction.