Press "Enter" to skip to content

Curated SQL Posts

Test and Validate Azure SQL Database Migrations

Marlon Ribunal has a tool:

Introducing azsql-migration-test, a small open-source CLI that validates your Azure SQL Database migrations against a local Azure SQL Database Developer container — the same engine as the cloud, running on your machine.

The problem: proving a migration works shouldn’t require the cloud

The tool is AI-generated and it looks like the blog post is as well, but it does look to be useful.

Leave a Comment

Improving Power BI Performance

James Serra has updated a guide on Power BI performance optimizations:

This post is a complete replacement for and update to my April 2022 post, Power BI Performance Features. That post focused on several performance features that were new or in preview at the time. Four years later, many of those features have matured, Microsoft Fabric has changed the architecture choices available to us, and Direct Lake has become an important part of the conversation. So rather than keep adding notes to an old feature list, I decided to step back and answer the more useful question: How should you design, diagnose, and improve Power BI performance today?

Here’s the bottom line: Power BI performance is not one feature, one setting, or one capacity size. It is the result of a chain that includes the data source, data preparation, storage mode, semantic model, DAX, report design, security, refresh process, and Fabric capacity. A weakness anywhere in that chain can become the bottleneck, which is why randomly changing DAX or buying more capacity often does not solve the real problem. The best approach is to make the right architectural choices first, measure what is slow, and then fix the layer that is actually causing the delay. For more info, see Optimization guide for Power BI.

Click through for James’s guidance.

Leave a Comment

Azure SQL Developer

Carlos Robles and Vandana Mahtani make an announcement:

Big news: Azure SQL Developer is here, in private preview. It’s the Azure SQL Database engine, on your laptop, in a container. Build against the exact engine you run in the cloud. Ship the same code to Azure. Change one line, the connection string, and you’re in production. Free for local dev and CI. No subscription. No credit card. No catch. Run it yourself, or hand it to an AI agent and watch it go. 

That’s pretty neat, especially because there is a surface area difference between Azure SQL Database and SQL Server.

Leave a Comment

Looping Databases on an Azure SQL Instance

Jess Pomfret has a script:

In the on-prem world, or when we’re working with SQL Servers on VMs, wherever they might live it was pretty easy with dbatools to run a query against all the databases, collect some info and collate it into one record set. This used to work with Azure SQL Instances too – but Azure auth, or cloud auth in general is hard and recently the Connect-DbaInstance command needed to change to make it more reliable.

So, this is a quick post to cover how we can still manage this.

Click through to see how.

Leave a Comment

Inbound Network Protection Feature Gaps in Microsoft Fabric

Meagan Longoria tells a cautionary tale:

Fabric’s inbound network protection gives you two tenant-level controls: Private Link, which routes traffic through your virtual network instead of the public internet, and Block Public Internet Access, which closes the public internet off entirely once Private Link is in place. Together they look like the obvious move if you’re trying to get a data platform off the public internet. Flip two settings, close off the internet, ship a more secure platform. That’s the pitch.

But read on to learn the downside cost to this: you’re giving up quite a bit of capability.

Leave a Comment

Ways to Impute Missing Data in R

The DataScience+ desk compares methods:

Missing data is the daily reality of medical and epidemiological work: a patient skips a lab draw, a questionnaire item is left blank. So in this tutorial I use real health-survey data and compare three current imputation packages on it: mice (multiple imputation, still the reference method for statistical inference), missRanger (random-forest imputation, the fast successor of missForest), and VIM (k-nearest-neighbour imputation). Before any imputing I use naniar, the modern, ggplot-native toolkit for missing data, to picture where the gaps are. I also include the method most analyses actually use by default, dropping incomplete rows, because seeing why it fails is half the point.

I start from complete records, delete values myself, and check each package against the truth I hid.

Click through for the method and different ways to impute data to fill in the gaps. The text of the article looks AI-generated, though the recommendations end up being pretty solid (at least in my experience with imputation and working with mice).

Leave a Comment

Page Splits in Animated Form

Brent Ozar paints a picture:

You’ve heard that page splits are bad, and they’re an indication that your table design is making your storage work too hard. You’ve heard that the right answer to fix it is adjusting fill factor lower, or doing regular index maintenance.

Before you watch the below animation, you’ll wanna get up to speed with how index seeks work. Then, let’s explain page splits with an animation:

Click through for the visual explanation.

Leave a Comment

Working with DATEDIFF() and DATETRUNC()

Erik Darling has a video for us:

So we’re going to talk about just some not terribly advanced stuff, but stuff that is at least worth making sure that everyone understands when it comes to the date diff function.

There’s not terribly a lot of advanced things to say about it, but who knows where you’re starting off. So one thing that seems to get on some people’s nerves is deciding on a boundary.

So when you say, I only care about a year of data, you need to think carefully about how you do that. 

This is one tiny part of how working with dates is so painful, and not specifically due to any gap in tooling but just in how complex date and time logic is. And that’s before we even think about the date math involved in working with the Future Semiconditionally Modified Subinverted Plagal Past Subjunctive Intentional.

Leave a Comment

Exfiltrating Data via sp_invoke_external_rest_endpoint

Vlad Druma slides some data past the bouncer:

In this post I cover how an attacker can take advantage of SQL Server 2025’s sp_invoke_external_rest_endpoint to exfiltrate data from a compromised instance.

In my previous post I used sp_invoke_external_rest_endpoint to get some data about internet-exposed SQL Server instances.
While doing that, I realized that, similarly to xp_cmdshell, SQL Server 2025’s sp_invoke_external_rest_endpoint can be used by an attacker to exfiltrate data from SQL Server.

Click through to see how.

Leave a Comment