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

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

You may already know that I typically use the series A Fish Out of Water when I want to write something that slightly deviates from my main blog topic: Enterprise Integration. This time, it is not an Enterprise Integration topic, but it is somehow related to it, as BizTalk Server utilizes this functionality to back up databases into Azure blob storage.

While I was trying to configure the SQL Server credentials for authentication to Azure Blob Storage, I made some incorrect configurations with the credentials I was setting up. The next question I asked myself was, how can I delete this 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.

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, which are managed by SQL Server. SQL Server protects these system catalogs to ensure the integrity of the system and prevent direct modifications that could lead to inconsistencies or cause 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. 

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