Press "Enter" to skip to content

Curated SQL Posts

Counting NULLs in SQL Server Tables

Vlad Drumea counts that which does not exist:

I’ve seen variations of the question “how to count all NULLs in all columns of a table” pop up on reddit once every couple of months, and I figured I’d give it a shot and post here in case anyone else might need it in the future.

Click through for the script. It does require M*N scans, where M represents the average number of columns in each table and N the number of tables in the database. In other words, don’t expect an immediate response.

Comments closed

Debugging R Code in Visual Studio Code

Yohann Mansiaux steps through the code:

We are going to see how to use these functions in VSCode, as well as introducing “breakpoints”. Breakpoints are markers that you can set in your code to pause execution at a specific line. This allows you to inspect the state of your code at that point and step through it line by line. They are very close to the browser() function. They can also be used in RStudio IDE, but I have to admit that I never used them.

Read on to see how VSCode fills the need when it comes to debugging code. H/T R-Bloggers.

Comments closed

Building a Multi-Agent Orchestrator with Flink and Kafka

Sean Falconer builds an orchestration engine:

Just as some problems are too big for one person to solve, some tasks are too complex for a single artificial intelligence (AI) agent to handle. Instead, the best approach is to decompose problems into smaller, specialized units so that multiple agents can work together as a team.

This is the foundation of a multi-agent system—networks of agents, each with a specific role, collaborating to solve larger problems.

Read on for the overview. There’s also a code repository and a free e-book on the topic.

Comments closed

Digging into Non-Idempotent Subqueries via CTE in PostgreSQL

Shayon Mukherjee continues pulling on a thread:

A few days ago, I wrote about a surprising planner behavior with CTEs, DELETE, and LIMIT in PostgreSQL, a piece I hastily put together on a bus ride. That post clearly only scratched the surface of a deeper issue that I’ve since spent way too many hours exploring. So here are some more formed thoughts and findings.

Click through for a deeper dive into the topic, including some key takeaways.

Comments closed

Authenticate to Fabric Data Connections via Key Vault Secrets

Aditya Jain announces a preview:

Azure Key Vault support in Fabric Data connections is now in preview! With this capability, we are introducing a new concept called ‘Azure Key Vault references’ in Microsoft Fabric, using which, users can reuse their existing Azure key vault secrets for authentication to data source connections instead of copy-pasting passwords, slashing credential-management effort and audit risk.

Click through to see what works so far and the current limitations.

Comments closed

Adding Carousel Buttons in Power BI

Boniface Muchendu builds a carousel:

Power BI carousel buttons allow users to cycle through visuals, measures, or text within a single report space—making your dashboards more interactive and space-efficient. While Power BI doesn’t include a native carousel visual, this guide shows how to simulate the same functionality using button slicers and field parameters. We’ll walk through several practical use cases, including switching between KPIs, toggling dimensions, and displaying text content, all with built-in Power BI features.

Click through to see how they work. I’m not a big fan of doing this on a proper dashboard, given that any visuals you’ve hidden on the carousel are no longer glanceable, but it’s a neat aesthetic idea for highly interactive reports.

Comments closed

Darling Data Blocking Monitor App

Erik Darling announces a tool.

If you’ve given Erik money in the past (which I can confirm is an easy enough task). If you’ve used sp_WhoIsActive to write to a table, you’ve got an idea of how it will work. But this looks quite a bit easier than setting it all up yourself.

And the next time you run into Josh Darnell, say thank you.

Comments closed

Model Documentation via Fabric Data Agent

Chris Webb gets some answers:

AI is meant to help us automate boring tasks, and what could be more boring than creating documentation for your Power BI semantic models? It’s such a tedious task that most people don’t bother; there’s also an ecosystem of third party tools that do this job for you, and you can also build your own solution for this using DAX DMVs or the new-ish INFO functions (see here for a good example). That got me wondering: can you use Fabric Data Agents to generate documentation for you? And what’s more, why even generate documentation when you can just ask a Data Agent the questions that you’d need to generate documentation to answer?

For a simple scenario, Chris was able to get pretty solid results. As complexity grows, your mileage may vary.

Comments closed

Resulting Data Types from a UNION Operation

Andy Brownsword puts on the lab coat and performs some experiments:

The UNION and UNION ALL operators allow us to combine results, but there’s no guarantee that each set of results uses the same data types. So what data types are returned?

For the longest time I thought the data types from the first set of results were used for the final results. That’s not the case.

Read on to see what the rules look like.

Comments closed

Breaking down the Limitations of R^2

M. Fatih Tüzen explains an important regression concept:

When building a statistical model, one of the first numbers analysts and data scientists often cite is the , or coefficient of determination. It’s widely reported in research, academic theses, and industry reports — and yet, frequently misunderstood or misused.

Does a high R² mean your model is good? Is it enough to evaluate model performance? What about its adjusted or predictive counterparts?

Read on to learn the answers to each question. H/T R-Bloggers.

Comments closed