Press "Enter" to skip to content

Curated SQL Posts

A Fabric App to Study for Microsoft Certification Exams

Shabnam Watson has a new app:

Have you ever sat down to study for a certification and thought, “Wait, where was I?”

Studying for a Microsoft exam takes time and sometimes work or life get in the way. Sometimes weeks go by between study sessions. With so many topics to cover, it’s hard to remember what you’ve already studied, what still needs work, and where to pick back up.

So, I built an app for it. It’s called Ready, Set, Cert! and it’s a Microsoft Fabric App! Let me tell you how it came together.

Click through for a link to the code, built with Claude.

Leave a Comment

Cardinality Estimation off of the Histogram

Erik Darling has a video:

But anyway, today we’re going to talk about off-histogram cardinality because recently I opened a feedback item with my dear and good friends at Microsoft with a humble suggestion to improve to improve our lot in life when dealing with this. And we’re going to talk about that. Down in the video description, you will find so many helpful links. Your mind will spin, boggle. You’ll, I don’t know. I don’t even know if your socks are going to stay on. You know, as a wise man once said, you better hope you have your wood screws in. You know, blow your doors off.

Click through to learn more about the topic. Erik shows how the optimizer can miss on data outside of the band that statistics cover, both over- and under-estimating the number of rows. When you’re working with telemetry data (for example), this can end up being a significant issue.

Thankfully, the police weren’t coming for Erik that time, so he was able to finish the video. Also, vote on Erik’s feedback idea. I did my part by clicking a button!

Leave a Comment

Error Action Sequences in Dataflows Gen2

Chris Webb handles an error:

Following on from my post two weeks ago about report bursting in Dataflows Gen2, I’ve learned something new about action sequences in M (thanks to Curt Hagenlocher for this, although it is mentioned in Ben Gribaudo’s post on actions) which deserves its own post.

Let’s take the first example I gave in that previous post showing how to send two emails using M in a Dataflow Gen2:

Click through for the issue and how you can build the equivalent of a try-catch block in M.

Leave a Comment

Moving TDE Certificates without Files

Jordan Boich performs a migration:

I’ve been automating a lot of the tedious and routine migration tasks for our team for the past few months. Leveraging tools like PowerShell and Azure DevOps Pipelines to consistently deliver results and accomplish the majority of the heavy lifting relating to DBA toil allows us to focus on other tasks and initiatives. While improving my pipeline process, I noticed that the TDE cert migration portion was unreliable and failing often. The specific step backed up the .cer and .pvk file to a network share and attempted to assign file share permissions, and restore the cert with its pvk to the destination server. Connectivity to the share was unreliable, and trying to play permission assignments to a share in flight proved to be more challenging than I was hoping. With that, I sought out a new way to skin the cat. Turns out, you can leverage the certificate’s binary metadata to migrate the TDE cert to another server without having to worry about physical .cer and .pvk files to make that possible. You don’t need a pipeline for this to be useful. Here’s what it looks like by hand.

Click through for the process.

Leave a Comment

What Was New for T-SQL Developers in SQL Server 2016

Jeff Taylor hits us with a few things:

For background, 2016 is the release where SQL Server started meeting developers where they already were. JSON came in. Security moved closer to the data with Always Encrypted, Dynamic Data Masking, and Row-Level Security. And for the first time, we got a built-in flight recorder for query performance with Query Store.

There’s a lot here, so let’s get started.

Jeff points out DATEDIFF_BIG(), which I had not used and did not know existed. In return, I would like to point out FORMATMESSAGE(), a function that I believe more people should know about. The downside to FORMATMESSAGE() is that there is no native date translation, so you’d have to convert dates to strings. But the upside is that you get f-string style support for writing outputs in T-SQL

Leave a Comment

The Pricing Trade-Off of On-Demand Microsoft Fabric Billing

Nikola Ilic takes F0 for a spin:

Most Fabric projects start with the same question: which SKU? F2, F8, F64? Basically, you had to pick a capacity before you knew your workload, and then live with that guess (or scale up/down if you chose the pay-as-you-go model).

On-demand billing, announced at FabCon Barcelona a few weeks ago and now in preview, changes the order. You can create an F0 capacity with zero provisioned CUs and pay only for what runs! You can also keep your existing capacity and move a single workload, such as Data Warehouse, to on-demand.

Instead of paying for a capacity whether you use it or not, you pay for the CU-hours you consume, at a rate that depends on the workload.

Two things work differently from provisioned capacity: there is no smoothing, and the rate ranges from 1x to 3x the pay-as-you-go price. Below are the mechanics, four real-life examples, and where on-demand saves money and where it costs more.

Click through for those scenarios and what each means for your wallet.

Leave a Comment

Finding Which Connections You’re Using in Microsoft Fabric

Greg Low performs a test:

I work with a lot of connections in Microsoft Fabric and one of the operations that’s still surprisingly hard, is working out if you can delete a connection that you think is unused. Back in Azure Data Factory and tools like it, I can directly see how many places a given connection is configured. But Fabric doesn’t show that.

But Greg has a fix for that.

Leave a Comment

Managed Identity per Database in Azure SQL DB

Pratim Dasgupta announces a new preview feature:

Say you’re building an AI assistant that answers questions about your customers’ shipments. Each customer has a database in Azure SQL Database and a private blob container full of files. The assistant doesn’t follow a fixed code path: what it reads depends on the question it’s asked. You’d like the boundary between Customer A’s files and Customer B’s to hold even if something above the database goes wrong.

Azure SQL Database can now draw that boundary at the database level. In this public preview, CREATE DATABASE SCOPED CREDENTIAL can use a managed identity that belongs to a single database, with external tables and OPENROWSET as the first features that use it. Software providers and enterprises can keep many databases on a shared logical server and still give each one its own storage permissions.

Click through to learn what was there before, why it isn’t enough, and what this provides.

Leave a Comment