SQL Flow Field Guide

DENY Database Scoped Credential

Catalog support for SQL Server 2022 (16.x) and 2025 (17.x)

DENY permissions on database scoped credential

What changes

Input
principal and securable names
Output or change
permission metadata

Syntax at a glance

DENY permission [ ,...n ] ON DATABASE SCOPED CREDENTIAL :: credential_name TO principal [ ,...n ] [ CASCADE ] [ AS denying_principal ]

Work example

A database principal must not reference a scoped external credential.

Check external data source ownership and the database features that need the credential.

Check your work The test principal cannot use the credential and approved consumers still authenticate.

Open Microsoft Learn for full syntax, permissions, and details for your version.