Press "Enter" to skip to content

Curated SQL Posts

OneLake Security and the Fabric SQL Analytics Endpoint

Freddy Santos takes us through the latest with respect to security in OneLake:

OneLake Security centralizes fine-grained data access for Microsoft Fabric data items and enforces it consistently across engines.
Currently in Preview and opt-in per item, it lets you define roles over tables or folders and optionally add Row-Level Security (RLS) and Column-Level Security (CLS) policies. These definitions govern what users can see across Fabric experiences.

Read on to see what you can do.

Comments closed

Custom Calendars in Power BI

Kenneth Omorodion needs a calendar dimension:

Before September 2025, there was a complex workaround to create time intelligence calculations in DAX catered to different calendar types apart from the standard Gregorian calendar. With the Power BI September 2025 feature updates (still in preview at the time of writing), it is now readily possible to define custom Power BI custom calendars based time intelligence, like Shifted Gregorian, ISO, and retail calendars, in the data model and then use the new extended DAX functions against these calendars.

The new feature eliminates the need for complex workarounds and ensures cleaner and more accurate reporting for organizations. This tip will explain the different calendars used in time intelligence reporting and how to define them based on the new calendar-based time intelligence capability in Power BI.

Read on for several examples of how this works.

Comments closed

PostGIS Tuning via pg_stat_statements

Paul Ramsey wants to make spatial querying faster:

A reasonable question to ask, if you are managing a system with variable performance is: “what queries on my system are running slowly?”

Fortunately, PostgreSQL includes an extension called “pg_stat_statements” that tracks query performance over time and maintains a list of high cost queries.

This particular post is more about pg_stat_statements in general rather than specific advice for PostGIS, but it does lay out some recommendations for using pg_stat_statements in spatial-heavy environments.

Comments closed

Microsoft Fabric Direct Lake Join Index Creation

Phil Seamark explains a recent change:

If you’ve been working with Direct Lake in Microsoft Fabric, you’ll know its magic resides in its ability to quickly load data. It loads data into semantic models from OneLake when needed. This feature eliminates the overhead of importing. But until recently, the first query on a cold cache might feel sluggish. Why? One reason for this is that Direct Lake must build a join index. This index is added to the model during the first query. This index is a critical structure that maps relationships between tables for efficient lookups.

Earlier, this process was single-threaded and slow, especially on large tables with high cardinality. The good news? That’s changed.

Read on to see how, what a join index is, and what this impact looks like in practice.

Comments closed

Learning Microsoft Fabric Real-Time Intelligence

Valerie Junk picks up a new skill:

If you are reading this article on my website, chances are you know me from my Power BI content, the videosarticlestutorials, or downloads, or you came across it on LinkedIn. I want to be upfront: I am a front-end/business person. I create reports that lead to action and help businesses make smarter decisions while building a data-driven strategy.

When I started talking about Fabric Real-Time Intelligence, people were surprised. Some were curious. Others probably wondered what had happened. For me, real-time reports push you to approach design in a completely different way because users need to take action immediately. Decisions happen in the moment, and that changes everything about how you visualize and structure information, so that got me interested!

Read on to see how Valerie picked up KQL as a language, as well as some of the challenges involved. I will say, the Eventhouse is also the fastest mechanism Microsoft has to query large amounts of data in Microsoft Fabric—it beats out the lakehouse and warehouse pretty handily.

Comments closed

Breaking Changes in SQL Server 2025

Rebecca Lewis goes over the list:

Every new SQL Server release comes with shiny features — but SQL Server 2025 brings more than just enhancements. It’s important to know that there are several breaking changes under the hood that could futz your upgrade if you’re not paying attention.

On the whole, it’s a pretty small list but there are a few things on here that could affect any given environment.

Comments closed

TempDB Resource Governor in SQL Server 2025

Brent Ozar tries out an update to resource governor:

We’ve finally got a way to defend ourselves. We can configure Resource Governor to divide people into groups (something that seems to be trendy lately), and then cap how much TempDB space each group can consume. You don’t even have to divide them into groups, either (take note, politicians) – you can just cap how much resources everyone can use altogether.

To keep things simple for the sake of this blog post, let’s just assume we’re limiting everyone’s usage altogether. 

Click through to see how it works, as well as some of the caveats that are going to require foresight before this works the way you’ll want it to.

Comments closed

Temporary Stored Procedures in SQL Server

Louis Davidson is only here for a little while:

Pretty much every T-SQL programmer knows about temp tables very early in their journey with the language. They are generally wonderful tools that, when used properly, can be invaluable for storing data for a short amount of time. When used improperly they can be somewhat problematic, but certainly they are a tool we all use regularly.

But did you realize you can create a temporary stored procedure as well? It is not something I had ever used before, and while I remember hearing they existed a few times over the years, I had never tried them. The other day. I was creating an informal demo of some data, and once I had written the main query that listed rows that needed to be looked at, I needed a way to display the details of some rows.

I’ve worked with production code that included temporary stored procedures one time, I think. Otherwise, I’ve never used them either. But read on as Louis takes us through the utility of this concept.

Comments closed

Trace Flag 1448 and Replication

Garry Bargsley covers the behavior of a trace flag:

In SQL Server environments where transactional replication runs alongside Always On Availability Groups (AGs), DBAs sometimes face a frustrating scenario: replication stalls when a secondary replica or subscriber is offline for maintenance, patching, or unexpected downtime.

By default, SQL Server’s Log Reader Agent is cautious. It only marks transactions as ready for replication once they are hardened on both the primary and all replicas. This ensures consistency across the AG, but it can also cause replication to stall if an asynchronous replica or subscriber is unavailable for an extended period of time.

Click through to see how it works and what the consequences are.

Comments closed

Using Log Parser to Preprocess Data

Lucas Kartawidjaja gives us a blast from the past:

When dealing with data inside SQL Server, especially when it’s delimited by a clear separator character, earlier versions (before SQL Server 2016) required us to write custom parsing functions—either as T-SQL user-defined functions or CLR functions. Starting with SQL Server 2016, we can use the built-in STRING_SPLIT() function to handle most of these tasks.

However, more often than not, we need to parse data that resides outside SQL Server—for example, in log files, CSV data, or other data sources. For these cases, I often use Microsoft Log Parser, a free command-line tool available here.

Click through for a demonstration of how it works. Or a reminder, if you’ve been in the business for a long long time.

Comments closed