Press "Enter" to skip to content

Curated SQL Posts

Capturing Failed Logins in Microsoft SQL

Aleksey Vitsko keeps a list:

Our requirement is to record unsuccessful login attempts i.e. failed logins for security and compliance reasons. The database estate includes SQL Servers, Azure SQL Databases, and Azure SQL Managed Instances. How can I configure auditing for failed logins for each of these database environments?

Read on for the answer in SQL Server, Azure SQL Database, and Azure SQL Managed Instance.

Leave a Comment

Power BI for Nonprofits

Stephanie Bruno breaks out the green visor:

Your nonprofit is ready to escape spreadsheet chaos and move into Power BI. Then you open the licensing page. Pro? Premium Per User? Fabric capacity? F2, F64, F-what?! If you’re a nonprofit trying to make every dollar count, figuring out what to buy can feel like reading a spellbook in a language you don’t speak. We get this question a lot, so here’s our plain-language guide.

Prices below are in USD and current as of October 2026. Microsoft changes licensing pretty often, so always double-check the official nonprofit offers page before you buy.

Read on for several tips on how to get the most out of Power BI if you do work for a non-profit organization.

Leave a Comment

ROLLUP, CUBE, and GROUPING SETS in T-SQL

Louis Davidson works with three amigos:

To get the total, there are a few ways, which I will demonstrate in the next sections on the aggregation functions, ROLLUP, CUBE, and then GROUPING SETS. Grouping sets are the most flexible, in that they let you do what the other two can do, but with more control. But knowing the others is important because it is how most ad hoc queries will be written.

It’s uncommon that I use GROUPING SETS() in my code, but every time I do, I’m thankful that it exists.

Leave a Comment

Choosing a Path for Data Warehouse Migrations

James Serra offers up some alternatives:

If you are migrating a data warehouse, there is a question worth asking before you start: should you recreate the existing solution on the new platform, or use the move to make it better? This applies whether you are moving from an on-premises Netezza system to Microsoft Fabric or from Azure Synapse Analytics to Fabric. My preference is to modernize during the migration when the business case and timeline support it. Even a conservative migration takes substantial work, so it is worth considering which additional improvements would make that investment more valuable for years to come.

Click through for pros and cons on four approaches, as well as James’s recommendations.

Leave a Comment

Choosing a Chunking Strategy for RAG Applications

Bala Priya C puts together a decision tree:

In this article, you will learn how to choose the right chunking strategy for a retrieval-augmented generation system by working through a structured decision tree tied to the properties of your documents and retrieval task.

Topics we will cover include:

  • What each major chunking strategy assumes about your documents, and when those assumptions hold.
  • A six-question decision tree that maps concrete document and retrieval conditions to specific chunking strategies.
  • The failure signals that indicate a chosen strategy is not working, and the fixes that tend to resolve them.

Click through for the list of strategies and when to include each.

Leave a Comment

Using a Continuous Axis for Date Tables in Power BI

Marco Russo and Alberto Ferrari gussy up a visual:

In a previous article, Creating a simpler and chart-friendly Date table in Power BI, we showed you how to create a Date table you can use in a line chart with a continuous X-axis instead of a categorical one, even when the granularity is the month rather than the day. That technique stores every level as a DateTime column and relies on custom format strings to display the month name.

The auto date/time feature in Power BI provides the same user experience using a different technique. Its hidden date table uses text columns for quarters and months, sorted by a numeric column. However, the line chart still offers a continuous X-axis when you drill down to the month level. We keep saying that auto date/time is not a best practice, but this behavior is useful. Can we obtain it with our own Date table? Yes, we can.

If you have a Date table in your model (as you should!), this article explains how to enable the continuous X-axis in your report when the user groups dates by year, quarter, month, or week.

Click through to see how it looks, as well as how it works.

Leave a Comment

Load Testing Azure SQL Database (Again)

Reitse Eskens is back in the fight:

When I started hammering Azure SQL again, I had a set of scripts to run and tried to figure out what was happening. For most databases, I could explain the results, but some didn’t make sense. I’ll get back to that later in this series.

A few years ago, I did a similar performance-testing series, where I created the data on the database itself using SqlStress to run a massive load of queries and see what happened. This gave a lot of interesting results, most of which are still valid, but I wanted to try something different.

After a look at some Standard SKUs, Reitse moves up to Business Critical:

My previous post on load testing Azure SQL covered the Standard Edition; today I’m moving to the Premium Edition, which is Business Critical in DTU shape.

Again, the calculation mixes CPU, Memory, and disk I/O. The main difference between Standard and Premium is cost. Premium is more expensive and aimed at mission-critical workloads. It has faster storage and built-in replication options. It also includes redundancy, with features designed to keep your solution online.

There are some interesting cutoff points in the tests that make a low-end P-SKU cheaper and just as good as a higher-end S-SKU.

Leave a Comment

Interpreting the Azure Landing Zone as a DBA

Jordan Boich reviews an architecture:

VNet, subnet, NSG and UDR are four key acronyms that exist between me and my DR replica. The first time I started peering into the network world, trying to figure out the nuance how Azure networking impacts SQL Server was a confusing experience. Honestly, I didn’t know what the heck I was looking at. I found through this project, however, that success lies in the foundation. And, setting up that foundation makes all of the downstream processes much easier. This post is going to cover setting up that foundation in Azure. The empty network will harness all of our future objects.

Read on for an extended analogy that helps explain the key networking concepts in Azure.

Leave a Comment

Version Store Accrual and Open Database Transactions

Erik Darling has a video for us:

Erik Darling here with Darling Data and in today’s video we are going to talk about why the version store won’t clear if any database has open transactions. I realized that I read it a little bit differently than it looks there because I had to say it is what we’re talking about where this asks a question, right, so the words don’t precisely line up. But don’t blame the robots for that. That looks weird in the transcript. Anyway, it sounded weird in my head as I was trying to phrase it because I’m looking at the words and trying to rearrange them. That was tough. I’m not as sharp as I used to be.

It’s okay, Erik; none of us are.

Leave a Comment