Press "Enter" to skip to content

Month: March 2025

SQL Server Views and Implicit Data Types

Kendra Little takes a peek at a view:

Views let you do dumb things by accident in SQL Server. Then they make you have to think way too hard to fix them.

Most of the time when people create views, they start by refining a SELECT query, then turn it into a view. People also often create multiple views that pull different slices of data and UNION the results together.

Combined, these two things easily lead to undeclared datatypes in views with problematic implicit conversions.

Read on for an example of this problem in action. Kendra’s example involved a view and a separate table, but you can also see this kind of thing pop up in a view that itself contains set operators like UNION.

Comments closed

SQL Server Performance Office Hours

Erik Darling answers a set of user questions:

You have said that table variables, CTEs, Change Tracking, and Azure Managed Instances all suck. Do you have a full list of “features” to avoid?

Click through for a video of Erik answering questions around deadlocks, terrible things, UTF-8, and more. And I like the nuance behind Erik’s answer of this particular question. It’s easy to say “this thing is awful” and be done with it, but often times, the answer is more of “In this particular circumstance, don’t use this thing because of reasons X, Y, and Z; instead, use this thing.” That’s a rather different answer.

Comments closed

Saving an Azure Database for PostgreSQL Backup to a Storage Account

Josephine Bush wants an extra copy of the backup:

This may or may not be helpful in the long term, but since I’m doing it to be super cautious, I figured I would blog about it. We migrated to Flex last week, and to be abundantly cautious, we’re putting the last single server backup into cold storage. You could also use this same process to offload Flex if you were going to delete a server and want to save a final backup or have some use case for saving backups to storage longer term.

Read on for the process. It’s not as simple as running a command or two, but Josephine does take us through the process.

Comments closed

Asynchronous Commits in PostgreSQL

Shayon Mukherjee discusses trade-offs:

I was recently looking into some workloads that generate a lot of I/O and CPU contention on some very high-write code paths and came across synchronous_commit (https://www.postgresql.org/docs/current/wal-async-commit.html). It can be very tempting to turn this off globally because the performance gains in terms of I/O, CPU, and TPS (transactions per second) are very hard to overlook. I noticed I/O completely gone, CPU down 20% (at peak), and a 30% increase in TPS. However, this comes with important trade-offs that are worthwhile keeping in mind.

Click through for more information. This sounds a lot like the delayed durability feature in SQL Server, though you have more fine-grained control in PostgreSQL versus it being a database-level setting in SQL Server.

Comments closed

Digital Signatures on SQL Server Stored Procedures

Rick Dobson signs a procedure:

This tip introduces the basics of digital signatures based on self-signed certificates for selected T-SQL objects (stored procedures, functions, and triggers) with T-SQL samples. Learn how to detect what happens to a digital signature when a stored procedure is accidentally altered by a database administrator or intentionally modified by a bad actor.

Click through for the process.

Comments closed

Deleting a Topic in Apache Kafka

Staff writers in the Confluent writing mines perform a deletion:

Can you delete a topic in Apache Kafka®The answer is yes—but the process depends on your Kafka configuration and the environment in which you are working (i.e., if it is self-managed, hosted in the cloud, or a fully managed Kafka service like Confluent Cloud).

Read on to see how you can do so, as well as some recommendations around deletion and topic management.

Comments closed

Building a Top N Analysis in Power BI

Hamza Boubou builds a dynamic report:

There was a requirement from my client that seemed simple at first but turned out to be a Trojan horse after deeper investigation. The goal was to create a Power BI Time Comparisons Top N Analysis page, giving users complete control over the Top/Bottom N products based on multiple metrics. Users needed to define the period, compare it with other periods, and adjust the N parameter dynamically.

Read on to see how Hamza was able to solve this customer request.

Comments closed

Reviewing Azure SQL DB Internals for Hints at SQL Server 2025

Brent Ozar does some digging:

Microsoft staff used to say that Azure SQL DB is “the next version” of the boxed product, meaning that Microsoft tested, tweaked, and proved new features in the cloud while they could still rapidly iterate over code, shipping updates to make the product more reliable and scalable. In practice, that’s not entirely true: some things never leave the cloud, and some things actually ship to SQL Server long before they’re available up in Azure SQL DB.

Today, we’re going to go through documented & undocumented system objects that are available up in the cloud today (March 2025), but keep in mind that some of these may be cloud-only. I’m just dumping out the list of Azure SQL DB objects that aren’t present in SQL Server 2022 CU17.

Read on for those sets, with the caveat that not all of this may necessarily be in SQL Server 2025.

Comments closed

Spatial Queries in Fabric Data Warehouse

Jovan Popvic reads a map:

Spatial data has become increasingly important in various fields, from urban planning and environmental monitoring to transportation and logistics. Fabric Data Warehouse offers spatial functionalities that enable you to query and analyze spatial data efficiently.

In this blog post, we will delve into the spatial capabilities in the Fabric Data Warehouse and demonstrate how to use the spatial functions in your queries.

This looks a bit like the way we perform spatial operations in SQL Server. Jovan shows off some examples of functionality, so check that out.

Comments closed