A fish out of water: How to delete a credential in SQL Server (sys.credentials table)

  • Sandro Pereira
  • Jul 31, 2025
  • 2 min read

As you may already know, I use the A Fish Out of Water series when I want to write about topics that slightly deviate from my main focus: Enterprise Integration. This time, the subject is not purely about integration. However, it is still related, since BizTalk Server uses this functionality to back up databases to Azure Blob Storage.

While configuring SQL Server credentials for Azure Blob Storage authentication, I made a few mistakes during the setup. That led me to a simple but important question: how can I remove an incorrect credential from the sys.credentials table?

My first reason was to go to that table and manually delete that row; it’s easy! But no, because I got the error:

No rows were deleted.

A problem occurred attempting to delete row 1.
Error Source: .Net SqlClient Data Provider.
Error Message: Ad hoc updates to system catalogs are not allowed.

📝 One-Minute Brief

Managing credentials in SQL Server can be tricky, especially when dealing with orphaned or misconfigured entries. This post explains how to identify and safely delete credentials from the sys.credentials table, helping administrators resolve authentication issues and configuration conflicts.

Cause

The error “Ad hoc updates to system catalogs are not allowed” occurs when you try to directly modify or delete entries in system views or tables, such as sys.credentials those managed by SQL Server. SQL Server protects these system catalogs to ensure system integrity and prevent direct modifications that could lead to inconsistencies or break the system to break.

Solution

To delete a credential in SQL Server, you should not modify system catalogs directly. Instead, you should use the DROP CREDENTIAL statement, which is designed to remove credentials in a safe and supported way.

Here’s the correct syntax to delete a credential:

DROP CREDENTIAL [credential_name];

In my case, for this BizTalk Server context, it would be something like:

DROP CREDENTIAL [https://<mystorageaccountname>.blob.core.windows.net/<mystorageaccountcontainername>];

Hope you find this helpful! So, if you liked the content or found it helpful and want to help me write more, you can consider buying (or helping to buy) my son a Star Wars Lego set. 

Buy me a coffee
Author: Sandro Pereira

Sandro Pereira lives in Portugal and works as a consultant at DevScope. In the past years, he has been working on implementing Integration scenarios both on-premises and cloud for various clients, each with different scenarios from a technical point of view, size, and criticality, using Microsoft Azure, Microsoft BizTalk Server and different technologies like AS2, EDI, RosettaNet, SAP, TIBCO etc. He is a regular blogger, international speaker, and technical reviewer of several BizTalk books all focused on Integration. He is also the author of the book “BizTalk Mapping Patterns & Best Practices”. He has been awarded MVP since 2011 for his contributions to the integration community.

Leave a Reply

Your email address will not be published. Required fields are marked *

The Ultimate Cloud
Management Platform for Azure

Supercharge your Azure Cost Saving

Learn More
Turbo360 Widget

Back to Top