Press "Enter" to skip to content

Category: Error Handling

sqlcmd in SQL Server 2025 and Certificate Chain Not Trusted

Vlad Drumea points out a new thing to keep an eye on:

SQL Server 2025 provides ODBC sqlcmd version 17 which enforces an encrypted connection.

If you’re trying to use it to connect to instances that don’t have a CA-signed certificate or where TLS encryption was never properly configured, sqlcmd will throw the famous “certificate chain not trusted” error message:

Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : SSL Provider: The certificate chain was issued by an authority that is not trusted.
Sqlcmd: Error: Microsoft ODBC Driver 18 for SQL Server : Client unable to establish connection.

The proper answer to this is to get trusted certificates. The workaround is what Vlad describes, so click through for that.

Leave a Comment

“Can’t Determine Relationships between the Fields” in Power BI

Marco Russo and Alberto Ferrari explain an error:

When you create a Power BI matrix, you drag and drop columns in the matrix, then add some measures, and Power BI figures out on its own which combinations of values to show. The process is so intuitive that we mostly ignore the details. However, Power BI sometimes cannot figure out how to populate the matrix, thus producing the error: “can’t determine relationship between the fields”. Adding a measure fixes the problem, but why? In some other scenarios, Power BI shows many empty rows, eliminating many of them only when you add a measure. Power BI shows a subset of the values in other scenarios, even when no measure is involved.

Read on for the explanation.

Leave a Comment

The Unreliability of Microsoft Fabric

Brent Ozar points out some major issues:

The link https://aka.ms/fabricsupport takes you to a localized status page that almost always shows all green checkmarks – even when the service is on fire. During last month’s 12+hour overnight outage, people were screaming on Reddit overnight that things were down, but the status dashboard was showing all green. When Microsoft employees woke up, they asked if people were still having problems – and then eventually got around to updating the status page to reflect the outage when it was clear that things were really borked.

Redditors have resorted to relying on reporting Fabric outages to Statusgator, who then tracks the time gap between a burst of user outage reports, to the time Microsoft actually updates their status page – and it ain’t pretty:

Click through for Brent’s take and an embarrassingly bad post-mortem. Given that Microsoft Fabric is a software-as-a-service product, there’s an inherent level of trust necessary in using it: you’re relying upon the platform team to ensure things are running smoothly and that you get what you’re paying for. Incidents like this erode that trust. Outages themselves are bad but they do happen. The real problem is in not embracing the outage: be clear with customers on current status and cause, and ensure people can easily see the history of events.

Leave a Comment

SQL Agent “Success” on Failure

Todd Kleinhans does not believe that green is good:

Far too many times, I have seen DBA(s) and others have this false sense that if the Agent run status shows green, then everything must be ok.

Click through for a funny story about a gas station robbery and examples of how a SQL Agent job can report success but actually fail. You also see this a lot with replication or tasks that are asynchronous in nature: the task is reporting that we successfully started whatever operation, but that doesn’t mean the operation itself succeeded.

Leave a Comment

PARSE_SYNTAX_ERROR in Microsoft Fabric Notebooks

Olivier Van Steenlandt runs into an error:

As mentioned earlier, I have been playing around with Microsoft Fabric intensively in the past few months. During this period, I ran into a specific issue with one of my notebooks. What happened? Well, I was starting on a new notebook in the evening and life happened… So I stopped playing around to do something else.

A few days later, I wanted to continue my work and remembered that I was required to change something in my data load from a csv file.

Read on for the cause of this error. It’s something that can affect anyone at any time. Even you. Well, probably not you, but the person next to you? Yeah, even that person.

Leave a Comment

Review those Logs

Kevin Hill has a public service announcement:

Most SQL Server crashes don’t come out of nowhere.
They leave breadcrumbs – red flags that something’s not right. The problem? If you don’t know where to look, you miss the signs…until it’s 2am and your CEO’s calling.

Let’s talk about how to listen for those whispers before they turn into full-blown alarms.

Click through for some advice on the topic. I’ll also note that everything Kevin mentions, you can automatically retrieve and centralize in a monitoring system, and once you have more than a couple of SQL Server instances, I’d recommend doing so.

Leave a Comment

Fixing OPTIMIZATION_REPLAY_FAILED Errors in SQL Server

Kendra Little fixes a problem:

Forcing plans with Query Store can be a powerful tool—until it mysteriously fails. In real production systems, plan forcing sometimes just… doesn’t work. One common culprit is the cryptic OPTIMIZATION_REPLAY_FAILED error.

If you’re hitting OPTIMIZATION_REPLAY_FAILED, try re-forcing the plan using @disable_optimized_plan_forcing=1.

Click through for a summary of the problem and additional helpful information on the issue.

Comments closed

A Required Privilege Is Not Held by the Client

Rebecca Lewis runs into a permissions error:

I received an email from a customer yesterday regarding their Replication, which began failing with this error after Windows updates were applied:

Message Replication-Replication Transaction-Log Reader Subsystem: agent servername-xxx2 failed. Executed as user: domainname\svcaccount. A required privilege is not held by the client. The step failed.

Slightly dummied, but the important content is in red.  What does that mean?  ‘A required privilege is not held by the client’… he didn’t change anything, I didn’t change anything – why is Replication suddenly failing with permissions problems?

Click through for the answer.

Comments closed

Why Use XACT_ABORT?

Josephine Bush answers a team member’s question:

This came up one day at my work when a developer was using it. I hadn’t used it before and thought I’d better check it out. It’s off by default in SQL server, but why would you use it?

Click through for the tl;dr version, followed by a more thorough explanation. I wouldn’t set XACT_ABORT on by default, but there have been plenty of instances in which I’ve wanted to handle a lengthier series of operations as an all-or-nothing job, and this is a great way to do it.

Comments closed

Error Handling in Powershell

Patrick Gruenauer catches ’em all:

Error handling is a critical aspect of writing robust scripts in any programming language. PowerShell provides a powerful structure for handling errors gracefully using trycatch, and finally blocks. These constructs allows us to manage exceptions and ensure that important cleanup actions are performed, even when errors occur. In this blog post, I will show you how to use try catch finally in PowerShell. Let’s jump in.

Click through to see how the logic works in Powershell, as well as how you can read the exception itself in the catch block.

Comments closed