Press "Enter" to skip to content

Curated SQL Posts

Tracking Object History in Flyway Desktop

Steve Jones looks at an update to Flyway:


It’s a small change, but a handy one. Flyway Desktop (FWD) now includes the object history for different schema changes, so as you are evaluating how your changes might fit in with others, or you are trying to determine where something broke, you can see a list of historical changes. This post looks at checking history quickly in FWD.

Click through for a demo.

Leave a Comment

Extracting Lineage Information from Microsoft Fabric Spark Notebooks

Gerhard Brueckl retrieves some information:

When building data platforms and data pipelines to populate them, one of the most challenging parts is orchestration. You need to figure out dependencies between your pipelines and activities, know the run times/duration and make sure to run them only when all upstream pipelines succeeded. From a technical point of view, this can be easily accomplished within Microsoft Fabric using runMultiple(). (I really dont know why Databricks doesn’t offer something similar out of the box?!?)

Now the next question that comes up is: “Where do I get those dependencies from?” – and this is exactly what this blog post is about!

Click through to learn how.

Leave a Comment

Window Functions and Virtual Tables

Dualcore DBA pushes a predicate:

In this post, we’ll look at some interesting behaviour I’ve stumbled across with window functions and derived datasets in SQL Server.

I came across a query in a workload that was looking to get the most recent thing per group, a representative example in the Stack Overflow 2010 Database is below. The database is provided under cc-by-sa 4.0 licence from Stack Exchange Data Dump, I am running in compatibility level 150 on a SQL Server 2022 instance installed on a VM with 8 cores and 35GB RAM, though the issue being illustrated also occurs in earlier compatibility levels.

Click through for the demonstration and to see what happens when you switch to compatibility level 160.

Leave a Comment

A Quick Primer on Microsoft Entra ID

Jordan Boich gives us a high-level overview:

As a DBA with on-prem and cloud experience, I feel confident in saying that I’m fairly well versed on the “DBA Domain” part of the shared responsibility model. However, if we really want to do our jobs right as data professionals, having an understanding of the entire infrastructure does wonders when it comes to making architectural decisions that can impact the entire system.

The struggle I’ve experienced being a DBA is that hearing things like “Entra ID” or “Microsoft Entra Domain Services” has me sitting in a position where I know of those things because I’ve been around it for years but not really having as deep of an understanding as I’d like to. In this post, I’m going to talk a bit about authorization, and authentication from the cloud perspective, specifically Azure, so that other fellow DBAs and data professionals can gain some insight, see what it looks like to operate in the Entra Admin Portal, and show that it’s not as overwhelming as I thought it would be.

Read on to learn more.

Leave a Comment

SQLAlchemy 2.1 and mssql-python Support

Matt Hyon and David Levy share some good news:

We’re pleased to share that SQLAlchemy 2.1.0 is now generally available, with built-in support for mssql-python, Microsoft’s Python driver for SQL Server. You can now use it with SQLAlchemy’s ORM and Core APIs through the first-party mssql+mssqlpython dialect.

If SQLAlchemy is already part of how you build, we want this to feel like a natural next step – not another thing to learn. The goal is simple: help you connect to SQL Server and Azure SQL with less setup, while keeping the tools and patterns you know.

The mssql-python library is worth it over PyODBC.

Leave a Comment

An Introduction to Data Dict

Malte Grosser describes a new project:

A data dictionary can record what each row represents, how values were measured and how tables fit together. Data Dict provides a format for writing this down alongside rules the data should satisfy. Both live in one file, data-dict.yaml. Its command-line tool checks the rules against the data and turns the dictionary into readable documentation.

The open-source project was initiated by Hadley Wickham and is supported by Posit. The format is designed for teams working across R, Python and SQL.

The post combines a high-level description of the Data Dict project, as well as one of the examples in frog jumping. H/T R-Bloggers.

Leave a Comment

Operational Blind Spots in SQL Server Security

Fabiano Amorim offers some advice:

The SQL Server attack pattern is consistent: attackers do not always need a spectacular vulnerability. They often succeed by chaining normal features that were granted too broadly, trusted too much, or monitored too narrowly. 

In this article, I’ll focus on operational blind spots in SQL Server. These are the features DBAs use every day to keep SQL Server healthy: linked servers, traces, Dynamic Management Views, Extended Events, and session-management commands such as KILL.

These tools, while necessary, also create visibility, automation, and trust paths that attackers can abuse after compromising a low-privileged application account or a local database owner. 

Because of this, a SQL Server DBA should know the answer to the following questions at all times: where am I exposed, what should I monitor, and what should I change first? In this article, you’ll learn the answers to all three.

Click through for the advice.

Leave a Comment

Users, Licenses, and Guest Access in Microsoft Fabric

Paul Turley manages a tenant:

Fabric doesn’t have its own separate licensing screen — you assign every license, Fabric included, from the Microsoft 365 admin center, the same place you’d manage Exchange or Teams. Easy to miss if you came into this world through the Fabric admin portal. Save yourself a search: bookmark the Microsoft 365 admin center alongside the Fabric admin portal, since you’ll need both within your first week.

Click through for some more tips and tricks around user management in Microsoft Fabric.

Leave a Comment

Building Business versus Data Apps in Microsoft Fabric

Soheil Bakhshi builds an app:

While building that application, I came across a few gotchas and limitations around its architecture. But there is also another Fabric Apps pattern that takes a quite different approach. Instead of creating an operational database, it uses the relationships, measures and business logic we already have in a Power BI semantic model.

Microsoft calls this the Data App template. In this article, I compare it with the operational pattern from my previous exercise, which I refer to as a Business App. They both run on Fabric Apps, but what happens underneath is different. Their security requirements, sharing model and licensing are different too. So, let’s go through what I tested, what caught me out, and where I think each pattern makes sense.

Read on to learn more.

Leave a Comment