Press "Enter" to skip to content

Curated SQL Posts

Mostly-On for Good Enough DR

Daniel Hutmacher has kept the robots busy:

For large parts of 2026, I’ve been working on building a commercial SaaS product (more info is coming) that will run on a bunch of client databases across multiple SQL Server Express containers. With that comes the complexity of maintaining a backup and DR strategy, which can be a hassle when you don’t even have SQL Server Agent, S3 backups, and certainly not clustering or Availability Groups. So the first thing I did was to hobble together some shell scripts that would run on a cron schedule on the host VMs. That worked.. fine, I guess. Backups were taken and shipped to a remote network share.

But you can already see where this is going.

Daniel has put together a solution to assist with automated backups and log shipping of SQL Server instances, and it even works with Express Edition. Click through to learn more and to grab the solution for free and under MIT license.

By the way, SQL Server 2025 Express Edition is a lot more capable than prior versions. You can now have 50GB databases in Express Edition and can use 4 cores on one socket (up from before). Your buffer pool is still limited to 1410 MB, but it’s no joke for lightweight database operations.

Leave a Comment

Validating JSON in SQL Server and .NET

Syed Salman validates some JSON:

Over time, I’ve encountered various issues with JSON during API (application programming interface) integration and data processing. Sometimes, a third-party API returns a different format. Other times, some fields are missing.

These problems are usually identified from API errors, incorrect data in the database, or issues reported by users.

Most developers assume the JSON coming from their own application or from a third-party API will always be correct, so sometimes skip validation to save time.

The result? Potential issues later on: runtime errors, incorrect data, or production issues that are difficult to debug.

The, err, people of distinguished age in the audience will probably look at this and say, “This was the whole point of XML.”

Leave a Comment

A Survey of Triggers in Microsoft SQL

Aleksey Vitsko gives us some triggers:

A trigger in SQL Server (and Azure SQL) is a special kind of stored procedure that executes automatically in response to a specific event inside the database engine.

A trigger can be bound to a database object, to database scope, or to a server scope. Unlike normal stored procedures, a trigger is never called manually.

Triggers are tightly integrated with SQL Server’s internal event system. When an event fires, SQL Server executes the trigger as part of the same transaction (for DML and many DDL operations), meaning the trigger can inspect the change, modify or add data, log to a table, or even roll back the entire transaction.

Read on for the taxonomy and when you might use each.

Leave a Comment

Assigning Permissions to Table Types in SQL Server

Greg Low explains:

When you use table types in SQL Server, you need to assign permissions on them, and usually EXECUTE permissions. On one of my mailing lists, I saw a posting about how the user was trying to assign permissions to a table type  (for use as a table-valued parameter), and was getting this error:

Msg 15151, Level 16, State 1, Line 11 Cannot find the object, because it does not exist or you do not have permission.

Read on to understand what the issue was, how to correct it, and why it’s an issue in the first place.

Leave a Comment

A Fabric App to Study for Microsoft Certification Exams

Shabnam Watson has a new app:

Have you ever sat down to study for a certification and thought, “Wait, where was I?”

Studying for a Microsoft exam takes time and sometimes work or life get in the way. Sometimes weeks go by between study sessions. With so many topics to cover, it’s hard to remember what you’ve already studied, what still needs work, and where to pick back up.

So, I built an app for it. It’s called Ready, Set, Cert! and it’s a Microsoft Fabric App! Let me tell you how it came together.

Click through for a link to the code, built with Claude.

Leave a Comment

Cardinality Estimation off of the Histogram

Erik Darling has a video:

But anyway, today we’re going to talk about off-histogram cardinality because recently I opened a feedback item with my dear and good friends at Microsoft with a humble suggestion to improve to improve our lot in life when dealing with this. And we’re going to talk about that. Down in the video description, you will find so many helpful links. Your mind will spin, boggle. You’ll, I don’t know. I don’t even know if your socks are going to stay on. You know, as a wise man once said, you better hope you have your wood screws in. You know, blow your doors off.

Click through to learn more about the topic. Erik shows how the optimizer can miss on data outside of the band that statistics cover, both over- and under-estimating the number of rows. When you’re working with telemetry data (for example), this can end up being a significant issue.

Thankfully, the police weren’t coming for Erik that time, so he was able to finish the video. Also, vote on Erik’s feedback idea. I did my part by clicking a button!

Leave a Comment

Error Action Sequences in Dataflows Gen2

Chris Webb handles an error:

Following on from my post two weeks ago about report bursting in Dataflows Gen2, I’ve learned something new about action sequences in M (thanks to Curt Hagenlocher for this, although it is mentioned in Ben Gribaudo’s post on actions) which deserves its own post.

Let’s take the first example I gave in that previous post showing how to send two emails using M in a Dataflow Gen2:

Click through for the issue and how you can build the equivalent of a try-catch block in M.

Leave a Comment