Press "Enter" to skip to content

Curated SQL Posts

T-SQL Tuesday 199 Round-Up

Koen Verbeeck wraps up another T-SQL Tuesday:

A good week ago I hosted the monthly T-SQL Tuesday blog party. I invited the community the blog about the idea of what would happen if we would need to go back on-premises, after a good decade of cloud computing. What would you need to do? How do you plan for this? What are the skills you might need to (re-)learn? You can find my take on this here, where I’m telling my junior colleagues that troubleshooting issues on-prem is more challenging, because it’s possible you need to go way down, all the way to Kerberos, SAN and DNS issues.

Click through for the contributions.

Leave a Comment

Moving Away from Average Fragmentation for Index Maintenance

Tim Radney proffers some advice:

As a SQL Server DBA with years of experience tuning production environments, I’ve seen the same patterns repeat: nightly index maintenance jobs running for hours, consuming massive CPU and I/O, only for performance to remain inconsistent or even degrade in some cases. Many of us (myself included, early in my career) relied heavily on avg_fragmentation_in_percent from sys.dm_db_index_physical_stats to decide when to reorganize or rebuild indexes. It’s time we move past that outdated approach and stop just doing what we’ve always done.

One thing I would add on to Tim’s advice is, determine whether that index even needs rebuilt or if you’re burning resources for no practical benefit. If there’s no practical performance benefit from the operation—and with all-flash arrays that are within an order of magnitude of RAM speeds, you might already be close to that point—then the index rebuild is for naught. The index maintenance strategy that we all learned back in the day was to minimize the time we spent waiting for spinning disks to reach relevant data. When random access lookups are approximately the same speed as sequential lookups, position on the disk doesn’t matter all that much.

Leave a Comment

Using Entra ID Authentication in Azure Database for PostgreSQL

Taiob Ali wants to use Entra for authentication:

During the livestream of my session at the POSETTE: An Event for Postgres 2026 conference, I received the following question on the hallway track via Discord:

I have one question : I added an Entra group as PostgreSQL Entra administrator, created/mapped the PostgreSQL role for that group, and granted permissions to that group. I am a member of the Entra group, but I still cannot log in with my own Entra user. Does Azure PostgreSQL allow group members to authenticate through the group role, or must each user also be individually created/mapped as a PostgreSQL role?

Read on for Taiob’s full answer.

Leave a Comment

Major Announcements from Microsoft Build 2026

James Serra puts together a list:

Once again there were a number of Microsoft Build announcements related to data and AI, and some were very impressive. Below are my favorites. I am prioritizing the data announcements first, because that is where my brain naturally goes (and because AI without good data is just a very confident intern with access to a keyboard).

The biggest announcements across Microsoft Fabric and databases can be found in the Microsoft Build 2026: Building agentic apps with Microsoft Fabric and Microsoft Databases blog post.

This looks like another year of Fabric + AI as the (almost) entire data platform focus at Build.

Leave a Comment

Fabric Data Agents and Power BI Row-Level Security

Jens Vestergaard digs into a security challenge:

In the last post I walked through auditing a semantic model before connecting it to an AI tool like Fabric Data Agent. Descriptions, naming, explicit measures, star schema: the things that decide whether a Fabric data agent generates an accurate query or a confident wrong one. I left one thing out on purpose, because it deserved its own post and because I got it wrong the first time I thought about it.

Security.

Click through for a few subtle security issues that automated agents can expose. It turns out to be a lot more challenging than you may first expect, just as Jens discovered.

Leave a Comment

Storage of XML Indexes in SQL Server

Hugo Kornelis continues a series on storage structures:

After covering on-disk rowstorecolumnstore indexesmemory-optimized storage, and memory-optimized columnstores, it is now time to turn our attention to storage structures that are used for specific datatypes only. The first “victim” will be the XML index.

When you need to store XML data in a SQL Server database, you can choose between two data types, each with their pros and cons. You can choose to store the XML data as nvarchar(max). This preserves the exact content of the XML as you received it, which might be required for legal reasons. However, any query that cares about the specific content of the XML data will have to resort to very complicated string expressions.

The xml data type shreds the XML and stores the content in an internal format, that allows SQL Server to work with for instance XQuery or XPath expressions. This format also saves space as compared to the nvarchar(max) alternative. However, when you query the data, the content will be the same, but formatting and whitespace might be different.

The latter also allow you to build indexes on top of them, and those indexes are what Hugo covers.

Leave a Comment

PBIR Files and Second-Class Report Server Citizens

Ronald Kraijesteijn tells a tale of woe with Power BI Report Server:

The setup is an on-prem Power BI Report Server, fully patched, running the May 2026 release (1.26.9637.31070, build15.0.1121.109). I had a report I needed to publish, but first I had to swap a whole batch of connection strings. Doing that by hand in Desktop is miserable, so I took a shortcut that turned out to be the root of all my pain. More on that below.

The error was a generic mess and the cause was getting too high for your station and actually expecting something from Power BI Report Server.

I say this as a fellow long-time Power BI Report Server sufferer.

Leave a Comment

Optional Parameters in DAX UDFs

Marco Russo and Alberto Ferrari give us an option:

When Microsoft announced that DAX User-defined functions (UDFs) are generally available (GA), another new feature was also announced: it is now possible to define optional parameters in a function and assign them default values.

A parameter is optional when the caller can leave it out. In that case, the function still needs a value to work with, so it falls back to a default. DAX provides that default through an expression written directly in the function signature, next to the parameter it belongs to. This is the mechanism we describe in this article.

Read on to see how it works.

Leave a Comment

Vector Calculations in SQL Server

Greg Low continues a series on vector data in SQL Server

:In this article, I’ll explain how to implement vector search in SQL Server using the VECTOR_DISTANCE and VECTOR_SEARCH functions. You’ll learn how vector indexes work, when to use them, and what the key trade-offs are — including the current read-only table limitation. I’ll also cover the latest syntax changes in Azure SQL Database, where that limitation has already been lifted.

Click through to learn more.

Leave a Comment

pg_ducklake 1.0 Now Available

Qiaosheng Liu makes an announcement:

We started pg_ducklake in January, and today we are releasing v1.0, the first production-ready version. Three things define this release:

  1. Full DuckLake workflow. v1.0 brings most of DuckLake’s feature set to PostgreSQL SQL: DML, schema evolution, time travel, partitioning, sorted tables, the variant type, ACID transactions, and automatic maintenance. Every table stays open to any DuckDB client.
  2. Production-grade. pg_ducklake is tuned to live inside an OLTP database: stable under continuous load, disciplined with memory, and offering the fastest ingestion path for DuckLake.
  3. Standalone and compatible. pg_ducklake started as a fork of pg_duckdb. v1.0 no longer forks or depends on it. It is a self-contained extension, built on a reusable kernel we extracted called libpgduckdb, and it stays compatible with pg_duckdb.

Read on to learn more about what’s in this production release.

Leave a Comment