Press "Enter" to skip to content

Curated SQL Posts

Migration Regret: SQL Server to Postgres Edition

Tim Radney provides an important reminder:

As a data nerd who’s spent the last 25+ years helping organizations keep their databases running smoothly, I’ve had this conversation more times than I can count: “We’re moving to Postgres to save on licensing costs.” It sounds great on paper, open source, no vendor lock-in, and those big SQL Server license fees go away. But lately, I’m hearing a different story from DBAs and architects after the migration is done. They’re calling it Post Regret. That sinking feeling when the promised savings evaporate, performance tanks, and the team realizes they might have been better off staying put (or at least doing a lot more due diligence).

If you’re considering a SQL Server to PostgreSQL migration (or already knee-deep in one), this post is for you. I’ll break down what Post Regret looks like in the real world, why it happens so often, and how to avoid becoming the next cautionary tale. I’ve seen it play out in enough environments to spot the patterns.

Click through for Tim’s tales of woe. Importantly, none of it is a knock on Postgres or a knock on SQL Server. It’s the fact that these are two separate products whose tuning options are very different. You can successfully migrate from one to the other, but to do so, you really need to have a great understanding of both platforms at scale, not just at the tutorial level.

1 Comment

Using the XMLA Endpoint for Power BI

Ruben Van de Voorde hits an endpoint:

Most Power BI developers have come across “XMLA endpoint” somewhere: a tenant setting, a Microsoft Learn page, or a tool’s connection dialog. The term sounds technical, and it is, but the idea behind it is straightforward.

Your semantic model is a database. Like any database, it lives somewhere: on your laptop while you’re authoring it in Power BI Desktop, or in a workspace once you’ve published it to the Power BI Service or Fabric. To use a database with anything other than the application that hosts it, you need a connection. The XMLA endpoint is that connection.

This article walks through what the XMLA endpoint is, where it comes from, how to turn it on, what you can do with it once you have it, and where the alternatives (the Power BI REST API, Semantic Link, and the Fabric REST API) fit in.

Click through for Ruben’s article, which does a good job of demystifying the endpoint.

Leave a Comment

Managed Identities in SQL Server 2025

Greg Low offers another security option for service management:

Those who have worked with SQL Server will understand the need to avoid storing passwords for accessing resources. Windows-based identities are fine for on-premises SQL Server systems, including those on cloud-based virtual machines (VMs), but are of no use when you need to access cloud-based resources like those in Azure.

Some Azure-based resources (including storage accounts) offer other access methods, such as shared access signatures (SAS), but these aren’t much of a step-up from passwords.

What’s really needed is for SQL Server to have its own Microsoft Entra based identity. These can be used directly with Azure-based resources – and that’s exactly where managed identities come in.

Click through to see how it works. Importantly, this is a feature that requires additional payment.

Leave a Comment

Making a Power BI Matrix Visual Look Nicer

Valerie Junk pretties up a visual:

Many Power BI developers view tables and matrix visuals as the enemy. They dislike building them, and often think, “the user is just going to export this to Excel anyway.”
But here’s the thing: tables and matrix visuals have an important business case, and sometimes a well-structured table communicates data far better than any chart would.

There’s also something we don’t talk about enough: trust. BI developers often assume users trust our data, but that’s rarely true. Many users have been burned before by incorrect data or unreliable tools. Providing a matrix visual for row-by-row verification is a powerful way to rebuild trust.

That said, a matrix visual that looks like default Power BI formatting isn’t doing you any favors. 

And they’re probably going to export it to Excel anyhow. Them’s the breaks.

Leave a Comment

Shredding JSON into Rows and Columns via T-SQL

Jared Westover shreds a bit of JSON:

Most databases I see nowadays have at least one column that stores JSON objects as NVARCHAR(MAX). If you look hard enough, I bet you have one. How do you convert JSON objects with arrays into a structured format of columns and rows? Not long ago, a developer asked me that exact question. It’s an important question given how rampant JSON is as a data exchange format, especially for web APIs.

This is a primer on SQL Server’s JSON functionality, at least when it comes to turning JSON into standard tabular data. I think, on the whole, SQL Server does a pretty good job of that, at least as long as your JSON data ultimately fits a tabular format.

Leave a Comment

Sharing Git Hooks with Team Members

Justin Bird shares a file:

Git hooks are scripts that Git executes before or after specific events, such as committing code or pushing to a repository. They can be used to automate tasks, enforce coding standards, or prevent specific actions. However, by default, Git hooks are stored in the .git/hooks directory of each developer’s local repository and are therefore not shared. This means that if you want to use the same hooks across your team, you need to instruct each developer to set up hooks manually, which can lead to inconsistencies and drift. In this post, we will explore a method to include Git hooks in a repository so that they can be easily shared with your team.

Click through to see how, and for a simple example.

Leave a Comment

Vector Chunking and SQL Server 2025

Greg Low breaks down a document:

If you’ve started to work with vector databases and looked at using text embeddings for AI search, you might have come across the term chunking and wondered what it relates to. In this article, I’ll explain the concept in general – and then show how it works in SQL Server 2025.

Read on for that explanation. Greg also includes a quick example of how this looks in SQL Server 2025 when passing text data through an embedding model.

Leave a Comment

Avoid JOIN USING in SQL Scripts

Lukas Eder covers an esoteric bit of syntax:

Some SQL operators are as esoteric as they’re powerful. One of the oldest operator that you’ve likely hardly ever used in real world applications is NATURAL JOIN which is the default in relational algebra. We’ve covered a funky use-case for NATURAL JOIN earlier on this blog.

Click through for a similar example using JOIN USING. It’s best to be specific in your SQL queries, at least the permanent ones that you add to scripts you expect to re-run in the future or make part of applications.

Leave a Comment

Filtering DAX Measures through Slicers

Marco Russo and Alberto Ferrari provide a deeper answer:

A very common request by Power BI newbies is, “How can I use a slicer to filter a measure rather than a regular model column?” The most common answer to this question is, “You cannot filter a measure through a slicer”. The answer is entirely correct because there is no such thing as “filtering a measure”. However, elaborating on the why gives us a good way to explain not only what is wrong with the question, but also how to further reason about the requirements needed to obtain a working solution.

This blog post is an example of how challenging it can be to answer a beginner’s question, where the immediate answer is “No, you can’t do that” but the underlying problem is solvable.

Leave a Comment

Moving System Databases in SQL Server

Rich Benner hires some movers:

As consultants, we often see system databases existing on the C drive on SQL Servers. There are some issues with this setup, and the biggest is: if one of your system databases grows and fills your C drive, you will likely crash the OS. If that happens, we’re in big trouble. Therefore, moving system databases becomes a necessary operation at times.

This is such a common issue because the default locations are set to C for these databases and that’s where they end up on fresh installs 99% of the time. Don’t worry! If you’re in this situation you’re not alone.

Click through for a query that shows which databases are on which drive and how to migrate databases post-install.

Leave a Comment