Press "Enter" to skip to content

Curated SQL Posts

Tips and Tricks with ALLSELECTED in DAX

Marco Russo and Alberto Ferrari take us through a complicated function:

ALLSELECTED is among the most complex functions in the whole DAX language. ALLSELECTED is the only DAX function that leverages shadow filter contexts. Moreover, ALLSELECTED has a slightly different behavior when used in SUMMARIZECOLUMNS or inside an iterator. Using ALLSELECTED with SUMMARIZECOLUMNS mostly produces the expected result, whereas using ALLSELECTED inside an iterator can produce weird results. Mixing the two techniques is the perfect recipe for a problematic report!

In this article, we briefly describe ALLSELECTED features in both scenarios (SUMMARIZECOLUMNS and iterators), and then we provide the best practices about the function, showing an example where mixing the two behaviors produces an unexpected result.

Read on to learn more.

Leave a Comment

Comparing Storage Options in PostgreSQL

Hans-Jürgen Schönig compares data sizes:

In this case study, we’ll delve into each of PostgreSQL’s main storage options, their characteristics, and the factors that influence their choice, enabling you to make informed decisions about your database’s storage strategy. You will also learn how you can archive data in a hybrid environment for long term storage. 

Click through for a comparison of two common file formats, plus two PostgreSQL-specific mechanisms for data storage. The comparison here is mostly one of final file size, though common query performance would be interesting to include as well, especially because the columnar data file types (Parquet and Citus-based columnstore) have a very different performance profile versus row-store data.

Leave a Comment

Error Handling in Microsoft Fabric Translytical Task Flows

Jon Vöge continues a series on write-back in Microsoft Fabric:

In my pursuit of testing out Translytical Task Flows and User Data Functions as a write-back alternative to Power Apps, I’ve come to spent a good amount of time trying to debug those features as well. Especially since they have a tendency to throw pretty non-descriptive error messages your way.

For this week’s blog post, I’ve made a small write-up of tips and tricks for troubleshooting and debugging translytical task flows, as this was something I struggled a little with myself.

Read on for several tips around better testing and error handling within these functions.

Leave a Comment

Ways to Debug T-SQL Scripts

Simon Frazer shares some tips:

At some point, every SQL developer or DBA will need to debug T-SQL scripts, either to verify that they behave as expected or to track down the root cause of a problem. Whether you’re building something new or investigating a production issue, debugging is an essential part of the process.

There are several techniques available for troubleshooting, and it’s important to approach this differently depending on whether you’re working in a production or non-production environment. Each environment has its own risks and constraints.

Click through for Simon’s process. I also echo Simon’s sentiments at the end regarding the SSMS debugger—I know people who are passionate about it and mourn its passing, but I was never one of those people. It was far too easy to get in trouble with it, especially in shared environments.

Leave a Comment

Access Limits in Microsoft Fabric Workspaces

Brian Kernan announces a change:

In August 2025, Microsoft Fabric will introduce workspace access limits to improve service quality, reliability, and to encourage workspace access control hygiene. This limit will be permanent once it is rolled out – each Fabric & Power BI workspace will be limited to a maximum of 1,000 users or groups in workspaces roles (Admin, Member, Contributor, Viewer). A workspace with a group over 1,000 individuals will not be impacted by this change, the number of users within a group is not impacted. Additionally, workspaces that are overlimit at the time of access limit enforcement will remain overlimit, but no additional users or groups can be added until the workspace is under-limit.

I read this and I say “Hmm…” I’m not in a position where I could say that 1000+ users in a workspace is a bad idea that they’re protecting us from, or if it’s an implicit acknowledgement of failure to scale.

Leave a Comment

Data Cleansing Tips in Pandas

Jayita Gulati shares some tips:

Data preparation is one of the most time-consuming parts of any data science or analytics project, but it doesn’t have to be. With the proper techniques, Pandas can help you quickly transform messy and complex datasets into clean, ready-to-analyze formats. From handling missing data to reshaping and optimizing your DataFrames, a few tricks can save you hours of work.

In this article, you will discover seven practical Pandas tips that can speed up your data prep process and help you focus more on analysis and less on cleanup.

Two of the tips are basically “use functional programming techniques,” and I’m okay with that.

Leave a Comment

Ingesting Logs into Microsoft Fabric Real-Time Intelligence via Logstash

Surya Teja Josyula and Ramachandran G. use one part of the ELK stack:

Logstash is an open-source data processing tool that enables the collection, transformation, and forwarding of data from a wide variety of sources. It acts as a data pipeline engine, helping organizations manage and streamline the flow of structured and unstructured data across systems.

Whether you’re managing infrastructure logs, application events, or telemetry data, this guide will walk you through setting up a seamless pipeline that bridges raw log data with real-time analytics in Fabric.

Click through for the process.

Leave a Comment

Regular Expressions in SQL Server 2025

Ed Pollack digs into some new functionality:

String-searching in SQL Server has always been a mighty hassle. Balancing performance and horribly-complex queries is a compromise that no one enjoys. 

Generally speaking, a relational database is not an ideal place to search large amounts of text. Even when leveraging features such as Full-Text Indexing, the ability for an application to leverage speedy text-searching decreases as data becomes larger. If a service optimized for text-search can be used, such as Elasticsearch or Azure AI Search, then it will be far easier to deliver accurate results quickly. 

Ed focuses on the mechanisms available rather than performance, and that’s the current sticking point. Whether regular expression queries will get faster in subsequent CTPs or SQL Server 2025 RTM, we’ll see.

Leave a Comment

Copying Azure SQL Databases between Subscriptions

Kenneth Fisher is back in the fight:

I recently had to copy an Azure SQL database (SQL db) from one subscription to an Azure SQL Server instance in another subscription. All of the help I found suggested going to the database and hitting the COPY option. Unfortunately, when I did, I ran into a problem.

Read on for the issue, as well as one way to fix it. The route Kenneth landed on was the same one I ended up going with when I had a similar problem and very limited access to SQL DB on both subscriptions.

Leave a Comment