Press "Enter" to skip to content

Curated SQL Posts

Moving the SSMS Status Bar to the Top of the Screen

Hemantgiri Goswami makes a move:

I have a strange preference. I keep my Windows taskbar at the top of the screen, and I have been doing so for years. Anything requiring attention shall be positioned at the TOP.

This isn’t about aesthetics.

When you administer Development, UAT, Pre-Production, and Production databases throughout the day, the SQL syntax doesn’t change. The query window doesn’t change. Sometimes, even the database names don’t change.

I’d never thought to do that before, to be honest.

Leave a Comment

Securing MCP Servers Connected to a Database

Dejan Lukic shares some advice:

AI agents don’t ask permission before every query. Instead, they themselves decide which tools to call and chain together. That’s a fundamentally different risk model than traditional access control – and it’s exactly why MCP (Model Context Protocol) servers connected to databases need their own security playbook.

This guide covers the failure modes to watch for: confused deputy, token passthrough, prompt injection, over-scoped credentials, and session hijacking. Then, how to prevent those failure modes – using authentication, authorization, and least-privilege controls.

Treat them like any other often-confused employee. Which, in many environments, means making them sysadmins.

Leave a Comment

Implicit INNER JOINs from LEFT OUTER JOINS

Dualcore DBA demonstrates how you can turn an outer join into an inner join on accident:

This post is a quick public service announcement to serve as a reminder to be careful with joins in SQL, particularly in queries with a large number of INNER and LEFT JOINs.

An INNER JOIN onto a LEFT JOIN will effectively make that LEFT JOIN an INNER JOIN.

This is a bit different from the other major case: a LEFT OUTER JOIN whose column you use in the WHERE or HAVING clauses.

Leave a Comment

Major Announcements from FabCon Europe 2026

Meagan Longoria has a list:

Policies were much needed. Until now, many Fabric capabilities were controlled by tenant switches that enable a feature for everyone or restrict it for everyone. Nothing was this fine-grained, which created blind spots and admin headaches. Fabric Policies let admins define who can perform an action, what the rule covers, and where it applies. If no rule matches, the action is denied.

The first three policy types are:

  • Item creation (capacity scope): controls who can create specific item types in workspaces on a capacity.
  • Edit workspace settings (tenant scope): controls who can change security-sensitive workspace settings, such as network security and customer-managed keys.
  • External data sharing (tenant scope): controls who can share data externally, from which workspaces, for which sensitivity labels, and to which recipient domains.

Policies are stored in Policy Set items and managed in the Policies Center in the OneLake catalog. They support public APIs and Git integration, and policy changes are recorded in the Microsoft 365 audit log.

Click through for all ten.

Leave a Comment

Updates to the VSCode R Extension

Chris Brown notes some changes:

I was doing some analysis work with R today (don’t get to do that very often anymore) and R wasn’t playing with VS Code nicely.

Turns out there has recently been a major update to the VS Code R editor extension.

So if you are having issues, check out the Extensions page for setup instructions.

Click through for some of the major changes and for some thoughts on Positron versus base VSCode. H/T R-Bloggers.

Leave a Comment

In-Memory DLLs and Digital Signatures

Emad Al-Mousa leaves a note:

While a valid cryptographic digital signature ensures the authenticity and integrity of a compiled binary, targeting dynamic database runtime components—such as In-Memory OLTP (XTP) directories—presents a severe attack vector if integrity controls are bypassed.

Because database services like SQL Server frequently operate under high-privilege service accounts (such as NT AUTHORITY\SYSTEM or a high-privileged virtual account), an adversary who achieves local administrative access could attempt to substitute or hijack dynamic runtime DLLs. A successful payload injection into the SQL Server process memory (sqlservr.exe) would inherit the service’s privileges, facilitating arbitrary code execution, local privilege escalation to SYSTEM, or the establishment of an outbound reverse shell.

Click through for a demonstration and Microsoft Security’s response.

Leave a Comment

Approximate Distinct counts in DAX

Chris Webb deals with management:

As you’ve probably seen in the blog post for the September 2026 release of Power BI, Import mode and Direct Lake mode semantic models now support the ApproximateDistinctCount() DAX function. I tested its performance on a Direct Lake semantic model with a 1.4 billion row fact table based on the NYC Taxi sample data and as you would expect, it was a lot faster than doing a regular distinct count in most cases.

Chris notes that the primary challenge is human: getting people to understand that, for their purposes and at the scale in which approximate distinct counts makes sense, non-biased approximations are just as good as actuals. That’s because 119,374,399 and 118,998,706 generally aren’t distinguishable in practice for things like monthly unique user counts. In both cases, the actual business user would still write “120 million” (or maybe “119 million” to be more precise).

Now, in cases in which the precise number does matter? Absolutely use the real distinct count. But those scenarios are rarer than you’d think.

Leave a Comment

How SQL Server Stores Spatial Indexes

Hugo Kornelis continues a series on storage internals:

To understand spatial indexes, we first need to understand a process known as “tessellation”. This is a process where a shape is divided into smaller elements, that then can be recursively divided even further, to result in a list of cells with, for each, an attribute that indicates whether the object partially or fully covers that cell.

Read on to learn more about the concept, how SQL Server uses the idea of tessellation to convert shapes into a practical tabular form, and why it’s so valuable to have an index over this form.

Leave a Comment

The Benefits of Database Cost Optimization

Chad Timms lays out some benefits:

Flexera’s 2026 State of the Cloud Report found that estimated waste in cloud infrastructure and platform spend rose to 29% this year. That is the first increase in five years. Managing cloud costs remains the top challenge for 85% of respondents. Your database estate sits inside that cloud bill through licensing, capacity, and the people who keep it running. It is rarely examined line by line. Database cost optimization seldom fails for lack of effort. It fails because the spend gets treated as a purchasing problem when it is really an operating one.

Renewals get negotiated. Cloud service tiers get compared. Meanwhile, the decisions that actually set the number are made on the ground, often by whoever is on call that week. Below are seven questions a finance or IT leader can put to their own team, or to a provider, along with what a strong answer and a weak answer sound like.

The target of this post is more for managers versus line employees, but it’s good to think about how you would answer the questions in the post.

Leave a Comment