Press "Enter" to skip to content

Curated SQL Posts

Upgrading an Expired SQL Server Evaluation Edition

Chad Callihan loses track of time:

SQL Server Evaluation editions are great to use for testing early releases. When the real deal comes out, it’s best to upgrade then and there (probably Evaluation to Developer if you’re testing and experimenting). But what happens if you let an evaluation edition expire by accident? The good news is you can still upgrade but it’s a bit tedious.

Click through to see how.

Comments closed

Running a Power Query Operation Only when Data Exists

Gilbert Quevauvilliers doesn’t waste time:

I had a requirement where I wanted to only have the underlying query run if there was data in the table.

As shown in the image below a query would run, scan 20GB and then return zero rows.

Instead of performing such an expensive scan, Gilbert provides an alternative. This is important in the case of querying the Synapse serverless SQL pool, as Gilbert does—in that case, the 20GB scan costs money.

Comments closed

Transport Layer Security and SQL Server

Michael Howard provides an explanation:

Invariably, when I ask people what Transport Layer Security (TLS) does, they say something like, “it protects my credit card info when I buy things online.”

The response is not incorrect, but it’s not the whole story, either, and let’s just ignore the server-side credit card protection requirements and PCI compliance for a moment.

TLS provide three security services, with an optional fourth.

Click through for those services and some of the ways we can improve our security posture when connecting to (or hosting!) a SQL Server instance.

Comments closed

A Use Case for Removing Schema Prefixes

Aaron Bertrand threatens to angry up the blood:

I’ve long been a huge advocate for always referencing objects with a schema prefix in SQL Server.

In spite of what may be a controversial title to many of my regular blog readers, I don’t really want you to stop that practice in most of your T-SQL code, because the schema prefix is important and useful most of the time. At Stack Overflow, though, there is a very specific pattern we use where not specifying the schema is beneficial.

Mind you, Aaron’s use case is a rather niche example, so I don’t plan on burning him in effigy. Just maybe singeing him a tiny bit.

Comments closed

Kafka Topics and Message Ordering

Francesco Tisiot calls us to order:

One of Apache Kafka’s most known mantras is “it preserves the message ordering per topic-partition,” but is it always true? In this blog post, we’ll analyze a few real scenarios where accepting the dogma without questioning it could result in unexpected and erroneous sequences of messages.

Click through for a dive into what can go wrong with ordering. The good news is, in most cases, exact ordering isn’t critical. For cases in which it is critical, you’re trading off reduced throughput for increased order integrity.

Comments closed

Building Strings in Powershell with StringBuilder

Robert Cain takes to a .NET class to build some strings:

As I was creating the next post in my ArcaneBooks series, I realized I had not written about the StringBuilder class. As the code in my ArcaneBooks module relies on it in several places, I thought it best to add a new post to my Fun With PowerShell series explaining how to use it before continuing.

It’s a common need in any language, and PowerShell is no exception, to need to add more text to an existing string.

Read on to understand why the StringBuilder class exists and how to use it. If you’re doing a lot of string manipulation, particularly of large strings in loops, this can provide a noticeable performance impact.

Comments closed

Handling Error 574 during a SQL Server Upgrade

Tom Collins sorts out a nasty issue:

Script level upgrade for database ‘master’ failed because upgrade step ‘msdb110_upgrade.sql’ encountered error 574, state 0, severity 16. This is a serious error condition which might interfere with regular operation and the database will be taken offline. If the error happened during upgrade of the ‘master’ database, it will prevent the entire SQL Server instance from starting. Examine the previous errorlog entries for errors, take the appropriate corrective actions and re-start the database so that the script upgrade steps run to completion.

Read on to learn what caused this error and how Tom was able to work around it.

Comments closed

Thinking about Execution Plan Icons

Hugo Kornelis polls the community:

Fast forward to today. More than five years have passed since I published the first pages of the SQL Server Execution Plan Reference. The world has changed, in many ways. But the icons on the reference pages have not. One might wonder whether the choices I made over five years ago are still relevant today. Or rather, I know that they are not all relevant anymore, I know that there is very good reason to rethink those choices. But this time, I prefer not to do this on my own. This time I am asking your feedback.

Click through for the entirety of Hugo’s request. My recommendation would be to keep the SSMS/ADS icon set but not old SSMS or SQL Sentry Plan Explorer. I like and still use Plan Explorer (and it’s the only third-party SQL Server execution plan reader I regularly use) but don’t need to see that icon set in Hugo’s documentation to understand what he’s covering.

Comments closed