Press "Enter" to skip to content

Curated SQL Posts

A Statistical Error

Hugo Kornelis tells a story:

Anyway, the load process at this customer had multiple steps. Truncate and then fill staging tables with the current data from various source systems. Use the data in those staging tables to update the first of the data vault tables. And then use a join between the same staging table plus the just updated data vault table, with a filter on the current date, to update all other data vault tables.

With some of the tables having more than 500 million rows and over 50 columns, this process needed some time. But that was not a problem. The load finished before the offices reopened. Usually. But not always. Sometimes, it would run a few hours longer. And nobody knew why the load would take extra time at those seemingly random moments.

Read on for the full story. It’s a sobering reminder that each environment is different, and something that worked really well in one environment may fare poorly elsewhere.

Leave a Comment

Improvements in the Microsoft Fabric Capacity Metrics App

Reitse Eskens is pleased:

In case you missed it, Microsoft released a new version of the Metrics App. We all know the current one, and we have opinions on it. But it’s all we’ve got from Microsoft, so we made do.

But now, there’s a new one. Or, well, a new one. When you install a new version, you get a second option!

Click through to see this new app, currently in preview. I wonder if it still requires the same level of permissions to see the contents. I recall that being a sticking point for capacity optimization in Fabric, especially when you bring in consultants who can understand the app but aren’t allowed to see it because of the necessary permissions.

Leave a Comment

Running SSIS Packages in Microsoft Fabric

Koen Verbeeck performs some ETL:

We have a large on-premises ETL solution built with Integration Services (SSIS). We are building a new data platform in the cloud using Microsoft Fabric. While we are building this, we would like to migrate the existing SSIS solution to the cloud so we can decommission our old servers. Is there an option to run SSIS packages in Fabric?

Click through for the answer, which is a solid “maybe, just so long as it fits this exact pattern.” But as Koen explains, some of the restrictions will hopefully go away as the feature matures.

Leave a Comment

The Trade-offs of Indexing

Rob Farley thinks about costs and benefits:

“How do you weigh the risk vs the reward of your database design decisions?” asks my old friend Pat Wright. And one of the examples he gives is around indexes. I like indexes, so let’s talk about some of the choices when you’re thinking about adding a new index. And for the sake of simplicity, a new nonclustered rowstore index.

A new index might make an expensive query be much faster. Users might feel like the application has become much snappier. But a new index is not free.

Read on for Rob’s thoughts.

Leave a Comment

The Power of Group Managed Service Accounts

John Sterrett gets rid of a password:

Somewhere in your environment, a SQL Server service account password hasn’t changed in years. Several people know it, and it’s probably in a script or a spreadsheet. I wouldn’t be surprised if someone hasn’t even put it in an AI chat.  Group managed service accounts (gMSAs) remove that problem.

This past weekend, during my Advanced Security Protection talk (online version you can watch) at Days of Data in Pittsburgh, someone asked: “What are the best practices for encrypting passwords in connection strings?” That reminded me I’m overdue to blog about Group Managed Service Accounts, so here we are, because the best way to encrypt them is to not need to encrypt them.

This does get a lot trickier if you’re not on Windows, and it does require Active Directory. But for most environments, gMSAs are an outstanding idea.

Leave a Comment

Keeping Documentation with Code

Andy Mallon shares some advice:

For years, I’ve advocated for keeping developer documentation in the same code repository as the code it describes. In the age of AI, that practice has become even more important.

The reason is simple: the easier we make it to maintain documentation, the more likely it is to stay current.

I do agree that having documentation live separately from code, most of the time, leads to outdated code. But then again, having documentation live with the code, most of the time, also leads to outdated code.

Leave a Comment

Using Screencast Mode in VSCode

Mike Robbins shares some good advice:

If you’ve ever watched a live demo where the presenter says “I’ll just run this” and code appears out of nowhere, you know how easy it is to lose the audience. They can’t see which keys you pressed, which command you ran, or where you clicked. Visual Studio Code (VS Code) has a built-in feature that solves this problem: screencast mode.

I learned about screencast mode from Steven Judd while we were teaching PowerShell together in the OnRamp program.

It’s easy enough to turn on before demos and off after the presentation. Between that and Ctrl +/- to zoom in and out, Visual Studio Code is very convenient for demonstrations.

Leave a Comment

SQL Server 2017 Has One Year of Support Remaining

Brent Ozar provides a reminder:

Even if you can knock out one of these per month on every 2017 & prior instance that you have, you’re still gonna be banging up against the October 12, 2027 deadline.

It’s not like your servers will magically stop working on that date – but if your company’s insurance or compliance rules say you’re not allowed to run out-of-date software, then it might be your butt on the line for not getting onto a supported version. (And if you’re subject to that, and you’re still running on SQL Server 2016, I’d be curious to hear in the comments how your experience went trying to purchase 2016 Extended Security Updates (ESU) from Microsoft.)

Brent has a list, and if you have any 2017 instances kicking, it’d be a good idea to get started on these.

Leave a Comment

Stretching an Availability Group to Azure

Jordan Boich begins a series:

Every IT person has lived this outage: the app is down, the database team says the database is fine, the network team says the network is fine, and infrastructure team says the DCs are fine. Everyone is right, and the app is still down. The problem is in the seam between us. My goal is to bridge that gap. Not only for myself, but to show others out there that from the DBA’s chair, the network, infrastructure, and the database don’t have to be such completely separate knowledge domains where one is a black box to the other.

To blame the network, you must understand the network.

Okay, that’s not true at all. But still, it’s a good idea to know this stuff.

Leave a Comment

UNC Paths on SQL Server Agent PowerShell Jobs

Dualcore DBA troubleshoots an issue:

It’s a classic backup job – run the backup using T-SQL and then upon success, purge the backup directory of backups that are older than a given number of days.

My backup job step backs up to a UNC path – \\192.168.2.174\Backups and then the PowerShell step will purge any backups older than 7 days.

Easy peasy…until it isn’t. Click through for the error and the solution.

Leave a Comment