Press "Enter" to skip to content

Curated SQL Posts

Updates to sp_Check Tools

Jeff Iannucci has a slew of updates:

We’ve been busy updating our suite of sp_Check tools, but…we forgot to tell you about that. And by we I mean me, so this post from me is to rectify that issue.

Speaking of issues, we have added a bunch of new issues to check for in sp_CheckSecurity recently. Fabiano Amorim and Andreas Wolter have been doing great work writing about SQL Server security issues, and we have tried to keep up with their findings by including new checks in sp_CheckSecurity. We would HIGHLY recommend updating your copy of that tool if you haven’t done so recently.

Click through for the full set of changes.

Leave a Comment

Testing Fabric Data Agent Accuracy and Determinism

Marc Lelijveld trusts but verifies:

Over the past year, I’ve written quite a bit about Fabric Data Agents. From configuring them and preparing Semantic Models for AI, all the way to deploying Data Agents using the Data Agent SDK. But once you start moving Data Agents beyond experimentation, another question quickly becomes relevant: “How do you actually know whether your Data Agent continues to return the right answer?”

Of course, you can open the Data Agent, enter a prompt and manually validate the response. That works perfectly fine while experimenting with a handful of questions, although it can already become quite time-consuming. Now imagine having to validate 20, 50 or maybe hundreds of questions, and not just once, but every time your data, Semantic Model, Agent Instructions or other parts of the solution change.

There is another aspect to this. With generative AI, we don’t only care about accuracy, but also about determinism. If we ask the same question again, can we rely on the Data Agent to consistently produce the expected outcome? This is where automated testing becomes increasingly important.

Read on to see how you can work toward answers for both.

Leave a Comment

Using Direct Lake across Public and Private Link Workspaces

Gilbert Quevauvilliers gets all of the data:

Currently in the Microsoft documentation it talks to not being able to connect from a Public Workspace to a Private Link workspace using DirectLake to a Semantic Model.

What this means in my mind is it is where it is a direct connection from a Public Workspace to a Private Link workspace

NOTE: A Private Link workspace is where inbound connectivity is blocked from the public internet.

In this blog post I am going to show you how to work around this, where at the end I will show you how you can still use DirectLake for a Semantic Model between a Public and Private Link Workspace.

Read on for the solution.

Leave a Comment

SQL Server and the Halloween Problem

Dualcore DBA takes a look at a historical problem:

The Halloween Problem gets its name from the day it was discovered – 31st October (some reports differ between 1975 and 1976). On this day, Donald Chamberlin, Patricia Selinger, and Morton M. Astrahan were working on the System R database project in an IBM lab and wrote a SQL query which updated a database, giving each staff member who earned less than $25,000 a 10% pay rise. The query completed, but every staff member then had a salary of at least $25,000 – this was not the expected output of the query.

They had inadvertently found a flaw in how the update was being executed – some affected records were updated more than once, until they no longer matched the filter criteria.

Click through to see how most data platforms, including SQL Server, resolve this issue.

Leave a Comment

Building a Rayfin App to Replay Soccer Games

Nikola Ilic builds an app:

On 29 November 2010, Barcelona beat Real Madrid 5-0 at Camp Nou. This week I “watched” that match again, event by event, on a pitch inside Microsoft Fabric: Xavi at 9′, Pedro at 17′, Villa twice after the break, and Barcelona’s xG line climbing to 2.77 while Madrid’s stayed flat at 0.13.

If you know me, you know I’m a huge football and Barça fan. So when Microsoft introduced Rayfin, the open-source SDK and CLI that deploys a full application backend straight onto Fabric, I knew what my first Fabric App would be: a live match center.

This post covers what I built, the scripts that turned the whole setup into one command, and a step-by-step guide to run the same Clásico in your own workspace.

Click through for the architecture and the process. Nikola also has the repo available if you want to re-create it yourself.

Incidentally, if you want to do something similar with American football, the NFLfastR package ties in with play by play datasets going back to 1999 and that get updated the day after each game.

Leave a Comment

Fixing “Too Many Connections” in Postgres

Achyut Tripathi makes a connection:

Database connections are essential for any program to manage and access data in the database. When a server already has too many active and open connections – a result of a large number of users creating numerous, simultaneous demands on the system – no new connections can open, and the system indicates that it has reached its maximum connection limit.

This issue can be caused by several factors, including connections that are opened unnecessarily and no longer used by the application, programs that create a large number of connections, incorrectly configured connection pools, and a sudden increase in traffic.

When these issues aren’t managed properly, the system encounters request failures – resulting in no new connections being made.

Read on to see how Postgres handles these and what you can do if you find yourself in that situation.

Leave a Comment

DAX Lib MCP Server

Marco Russo makes an announcement:

At the end of 2025, we launched DAX Lib, a public repository of DAX user-defined functions. So far, importing a DAX library has required a few manual steps, like clicking Add to Power BI on daxlib.org and then copying and pasting the DAX code into the TMDL View of your model, or using the dedicated tool in Tabular Editor 3. Both work well, but if you already use an AI assistant next to Power BI Desktop, we can now delegate this task to it. The DAX Lib MCP server version 0.1.0 is available now.

Click through if you’d like to snag a copy. It’s only available for Windows at this point, though considering Power BI’s OS requirements, that makes sense.

Leave a Comment

Reviewing Optimized Locking Results

Louis Tochon wants to know if optimized locking actually ran:

In the first case, SQL Server escalated the row locks to an X lock on the whole table. In the second, there is no escalation anymore, only one X lock on the transaction ID (XACT), next to the intent lock (IX) on the table (the IS lock in both results is on the small function I used to run this query).

That is nice in a demo, but on a real server nobody is looking at sys.dm_tran_locks at the right moment. I wanted to know how a DBA can check what optimized locking does once it is enabled. SQL Server 2025 has a few Extended Events for that, and I found some of their fields easy to misread and one of them reports LAQ as enabled on a database where it never ran once.

Click through to learn more.

Leave a Comment

Tips for Planning a Microsoft Fabric Solution

Paul Turley shares some tips around the various Microsoft Fabric workloads:

Fabric hands you an entire toolbox of analytics workloads. Using all of them isn’t the goal — using the right ones is.

Resist the shiny-object trap. Fabric packages Power BI, Data Factory, Data Engineering, Data Warehouse, Data Science, and Real-Time Intelligence into one platform, and it’s tempting to adopt all of them at once. Map each workload to a business problem you already have, and bring in only the pieces that solve something real today. Every workload you adopt without a real use case behind it is one more thing your team has to learn, maintain, and eventually explain to an auditor.

Click through for a half-dozen such tips.

Leave a Comment