Press "Enter" to skip to content

Curated SQL Posts

Defining a Data Science Pit of Success

Bruno Rodrigues thinks about robustness in data science:

Rico Mariani, a long-time performance engineer at Microsoft, coined the idea of the pit of success. A system has a pit of success when the natural, lazy way of using it leads to good outcomes. You don’t need heroics or perfect memory. You fall into the right result, and climbing out to do something wrong takes deliberate effort.

I came across this framing in a talk that I was recently recommended and I further recommend it to anyone interested in the topic: Functional architecture – The pits of success – Mark Seemann. It put a name to something I had been circling around for years.

This is worth a careful read if you’re tied in with a data science team. H/T R-Bloggers.

Leave a Comment

Consolidating Postgres Databases using Logical Replication

Dimitri Fontane explains a process:

This architecture is the one the documentation lists as “consolidating multiple databases into a single one, for example for analytical purposes”. The application developer’s version: three different applications (a shop, a CRM, a billing system), each with its own schema and its own server, all feeding a warehouse; and then the warehouse’s changes exported to something that is not Postgres.

Click through for examples, as well as what limitations you’re liable to run into along the way.

Leave a Comment

Choosing a Fabric Rollout Strategy

Paul Turley makes a recommendation:

Pilot versus enterprise-wide is the wrong debate. The real question is which one your organization is actually ready for.

Start narrow, then earn scale.

Microsoft’s capacity planning guidance recommends beginning with a proof-of-concept phase on a free 60-day trial capacity, a single use case, a small user group, and an isolated workspace so nothing touches production. You’re testing the concept, not committing the whole company. That isolation matters as much as the scope — keeping the proof-of-concept out of production workspaces means a bad assumption costs you a workspace, not a week of executive reporting.

Read on for a few more tips along these lines.

Leave a Comment

Connection Pooling with Microsoft.Data.SqlClient

Malcolm Daigle has an update:

You told us that applications using Microsoft.Data.SqlClient can take too long to establish the database connections they need. When many requests need connections at the same time, waiting for the connection pool to grow can delay application readiness and increase latency. This can happen even in common situations like querying several pieces of metadata during startup or receiving a burst of traffic after a quiet period. Microsoft.Data.SqlClient’s new connection pool (Pool V2) is designed to address this problem by establishing new connections concurrently, allowing the pool to respond more quickly when multiple requests need new connections at the same time.

Click through to see how this differs from prior behavior, and to see how well it performs.

Leave a Comment

Time Zones and Offsets in SQL Server

Erik Darling doesn’t know what time it is:

Or maybe you just started a new job where they cared about time zones and then your other jobs didn’t. So any, all kinds of crazy things can happen. But when you’re working with time zones, especially if you have dates that are not time zone oriented in any way, like for example, this one, this is just a date time too.

And getting used to the functions and how they work and behave can be a little tricky at first. It can be a little mind numbing. So if we run this query, what I want to show you is just we start off with a date time too that has no time zone affiliated with it.

In November, Erik will be right about Eastern time being UTC-5, as that’s Eastern Standard Time. Or maybe Erik is secretly in Indiana, in one of the counties that stays on Eastern Standard Time year-round. Hopefully I didn’t secretly dox him here.

Leave a Comment

Power Query Linting for Code Coverage

John Kerski has an update to pql-test:

Several years ago, I wrote a blog article introducing the concept of code coverage for semantic models: Part 8: Bringing DataOps to Power BI. With the state of Power BI technology at the time, the bridge was a little far and implementation was quite arduous.

That has changed. With Power BI Project files and User-Defined Functions becoming generally available in 2026, we now have detailed inspection possibilities with what tests exist, what specifically is being tested, and where the gaps in testing live.

I’m happy to announce that version 0.1.18 of pql-test introduces our first attempt at code coverage for semantic models: pql-test code-coverage.

Click through to see what’s new, as well as links to pql-test and more.

Leave a Comment

Working with Classes in PowerShell

Patrick Greunauer creates a class:

With PowerShell 5.0 and later, PowerShell supports object‑oriented programming by allowing you to create and use classes. Classes help you structure code, model real‑world entities, and reuse logic more effectively.

Click through for an example. Just as with most things, as soon as PowerShell starts moving from scripting to proper .NET work, it’s clear just how much less typing C# and F# require for the same thing.

Leave a Comment

SQL Copilot “Read-Only” Mode Wasn’t

Rebecca Lewis reads a CVE:

I was in Italy for a month. While I was gone, somebody got sysadmin out of SQL Copilot with a variable.

The vulnerability is CVE-2026-65669, the SSMS 22 Copilot bug I wrote about early September. The full write-up went public on September 30th, and the detail that stuck with me is how Copilot’s ‘read-only mode’ was enforced. It wasn’t a permission. It was a regex blocklist.

That blocklist is the same control we have watched fail against SQL injection for twenty years. Before I get to Copilot, let’s build one here and see it fail.

These sorts of blacklists almost never work against a committed attacker because, unless you fully enumerate the possible domain, there’s an opportunity for someone to slip through, and that’s exactly what happened here.

Leave a Comment

The Basics of GROUP BY

Louis Davidson gets back to basics:

For a while now, I really have wanted to learn the Windowing Functions in great detail. I know them well enough to make it through a lot of needs, but there are a lot of intricacies that are hard to remember. As I noted in my very first Blogging for Programmers post, writing for your own future needs is some of the best and easiest writing you will do.

When I wrote my “SQL Techniques you should know” presentation, the topic that took the longest was Window Functions. Because of their similarity to GROUP BY, I figured this was the best place to start.

Read on as Louis works through the concept.

Leave a Comment

Thoughts on the Shared SQL Server Database

Kendra Little shares some thoughts:

For more than 20 years, many small and medium SaaS companies have built products with complicated business logic and a flexible user experience on the .NET stack using an architecture with a shared SQL Server database. This approach has kept the production environment relatively simple.

These companies have new incentives to move away from this architecture because agentic development lands new business rules on the shared database fast enough to painfully cut velocity and add significant risk to deployments.

I’m not sold on the idea, but I think Kendra’s post is definitely worth the read and some noodling.

Leave a Comment