Tag: syndicated

  • The Book of Redgate: Products

    We are product focused at Redgate Software. Here is another of our values that focused on this:

    2026-04_0231

    The text on the next page is:

    Shipping something amazing is better than creating something average and to budget and on time. We cannot market, sell, manage or account our way to success.

    We have tried to do that. I’ve used many of our products before coming to work for Redgate. My former partners at SQL Server Central used them extensively as well. Since I have been an employee, I’ve worked with a lot of customers who constantly find value in our products.

    I think we’ve succeeded, and I think that us trying to build useful software is what has helped. My fellow advocates and I constantly try to bring the voice of the customer to Redgate so that our engineers better understand your challenges. This helps them build things that are useful.

    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.

  • Changing the Owner Removes Permissions: #SQLNewBlogger

    This is actually inspired by an article SQL Server Central, which taught me something new. I decided to verify what was in the article and do some research. The summary

    tl;dr if you change the schema owner, all permissions are dropped.

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

    The Scenario

    We start by creating three logins and their corresponding database users. Think of them as three colleagues with different roles:

    • User1 — will own the schema
    • User2 — will be granted access to a table
    • User3 — will eventually take over schema ownership

    Imagine there are a lot of User2 variants, as different logins are granted access to this table. To me, this is a problem, and I would use a role if I managed the system.

    CREATE LOGIN User1 WITH PASSWORD = 'Demo12#1'
    CREATE USER User1 FOR LOGIN User1
    GO
    CREATE LOGIN User2 WITH PASSWORD = 'Demo12#2'
    CREATE USER User2 FOR LOGIN User2
    GO
    CREATE LOGIN User3 WITH PASSWORD = 'Demo12#3'
    CREATE USER User3 FOR LOGIN User3
    GO

    Next, we create a schema explicitly authorised to User1, then add a table to it and populate it with some sample data.

    CREATE SCHEMA MySchema AUTHORIZATION User1
    GO
    CREATE TABLE MySchema.MyTable (myid INT)
    GO
    INSERT MySchema.MyTable (myid)
    VALUES (1), (2), (3)
    GO
    SELECT * FROM MySchema.MyTable
    GO

    At this point, User1 owns MySchema. Any objects inside it — like MyTable — fall under that ownership.

    Now we grant User2 SELECT permission on the table. This is straightforward, explicit, and intentional. I’ll perform an explicit grant of permissions here.

    GRANT SELECT ON MySchema.MyTable TO User2
    GO

    We can verify it works by impersonating User2 and running the query:

    SETUSER 'User2'
    GO
    SELECT * FROM MySchema.MyTable
    GO
    SETUSER
    GO

    The query succeeds and returns all three rows. So far, everything is working as expected, as we see below..

    2026-06_0119

    Now, the tricky part I didn’t know.

    Here’s where things get interesting. A database administrator decides to transfer ownership of MySchema from User1 to User3:

    ALTER AUTHORIZATION ON SCHEMA::MySchema TO User3;
    GO

    This might seem like a routine administrative change — just updating who “owns” the schema. No permissions were explicitly revoked. No error is raised. But something has quietly changed.

    If I now run the code above, I can’t access the table as User2.

    2026-06_0120

    I’ve lost access. If I check the ALTER AUTHORIZATION docs, I see this, with the last sentence being the important one. Permissions are dropped.

    2026-06_0122

    Something to know, and glad that Prompt AI knows this:

    2026-06_0121

    Summary

    If you change the owner (authorization) on an object, and it’s not a database, permissions are dropped. This should be a warning at the very least, though to be fair, I’ve never changed schema ownership. It could happen, but in general, I try to keep dbo as the owner of all schemas.

    In any case, something good to know.

    SQL New Blogger

    I took some code from an article I read (edited, really) and then used it to setup a scenario to test the concept. I likely will never forget this, and if I an AI suggests this, or can’t figure out what went wrong, I’ll have some idea myself to verify or validate a fix.

    This post took about 20 minutes, including running the code a few times to test things, but it was a good exercise to show what I know, how I can use AI, and how I can spot issues.

    You could use something like this as a learning exercise and to showcase your skills, even in the age of AI.

  • Flyway Tips: Immediate Code Review for Developers

    At the Redgate Summits this year, we’ve highlighted a few things in the Flyway solution that help developers improve their ability to get work done safely and quickly. While lots of developers are moving to automated systems and catching issues in pipelines, plenty of you are still working in an IDE.

    This post looks at the new code analysis feature in Flyway Desktop that can help warn you of potential issues before you create that PR.

    I’ve been working with Flyway and Flyway Desktop and helping customers improve their database development. This series looks at some tips I’ve gotten along the way.

    Generating Good Migration Scripts

    Flyway gives you determinism and consistent scripting when you generate migration scripts. Plenty of developers still do this manually, often after a lot of work and testing is done on the schema model. Once you’re sure of the changes you want to make, you can select those changes to include in a deployment.

    As you can see below, I have a lot of changes, but I want to just pick one to put into a deployment.

    2026-07_0253

    If I click on the change, you will see that this is simply adding a new column, something developers do all the time. I’ll select that and click “Generate Migrations”2026-07_0254

    When the tab changes, the default screen shows the next numbered migration script, based on my patterns and a default description of my name. Note that there is also a “Code review checks in progress” item to the left, which is running as the code is generated.

    2026-07_0256

    Once this completes, you can see my code rules passed, and the Flyway AI has generated a better description of the changes than I might have typed in.

    2026-07_0257

    There are a number of rules by default, and these are run when the migration script is generated. You can change, add, disable, customize, etc. for these rules as appropriate for your project.

    Let’s go back and select a different change. In this case, I’m selecting the “Grant” table and dropping it. It’s in the current view of the db, but not the next one.

    2026-07_0255

    When I click Generate Migrations and go to the next tab, you can see that the code review shows me two things: a high severity error and a warning. These are summarized at the top next to the “2 issues” button (which hides or reveals the details) as dots. If I had a lot of issues, and some of you do, this gives me a quick look.

    2026-07_0258

    Below that I get the details. Both of these are for the same line, which is highlighted in the middle by a triangle next to that line.

    If I click the High Severity item, I have the options to learn more, which links to the actual rule on the Redgate documentation site. Or I can ignore it. This allows me to comment in the code to not run this review again.

    2026-07_0259

    For the warning, since this wouldn’t stop a deployment anyway, I just have a Learn more link.

    2026-07_0260

    There are certainly times this might be the desired action, so I like the ignore button. However, much of the time developers might be making changes to objects and not thinking about potential future issues. Code review here catches things early, before others have to get involved, and helps educate developers about the styles and standards we want enforced in our projects.

    If you work with Flyway, update your desktop and give it a try. We would love to hear your feedback.

    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

    Watch me do this in video:

  • Learn about Modern Microsoft Apps in San Diego

    I wrote about learning today for the editorial: I Can’t Make You Learn. I sure hope you want to learn. It’s been great for my career and it will help yours.

    Join me this September in San Diego (register). I used to live there (Carlsbad) and it’s a beautiful, wonderful part of California to visit. VS Live comes to San Diego, and I’m honored to be speaking this year.

    2026-07_0297

    Visual Studio Live! (VSLive!) San Diego 2026 is at the Bahia Resort Hotel, September 14–18, 2026 in San Diego, CA. It’s five days of immersive developer training right on Mission Bay.

    I think actually worked as a waiter for a wedding in this hotel. If not this one, then one of the others right there on Mission Bay. It’s a great place to stay and I’m looking forward to going back.

    Whether you’re building modern apps on the Microsoft stack (.NET, ASP.NET Core, C#, Blazor, .NET MAUI) or focused on cloud and AI (Azure, GitHub Copilot, AI-powered development, Kubernetes, modern data platforms), this is real-world instruction, hands-on labs, and direct access to expert speakers, Microsoft engineers, and MVPs. Learn more: vslive.com/sandiego

    I’ll be discussing local LLM models, which I think are important for the future. You might not want an LLM on your laptop (maybe a MLM or SLM), but your org might want local models in its data center. I’ll also be discussing the Data API builder, which is a great piece of tech that makes your development against a database much easier, whether you write the code or an AI agent helps.

    Save $500 off standard pricing with my exclusive code JONES. Be sure to register by July 17th.

    Register with my code here: https://na.eventscloud.com/ereg/newreg.php?eventid=865669&discountcode=JONES