SQL Flow Field Guide

DENY Database Permissions

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

DENY permissions on database

What changes

Input
principal and securable names
Output or change
permission metadata

Syntax at a glance

DENY <permission> [ ,...n ] TO <database_principal> [ ,...n ] [ CASCADE ] [ AS <database_principal> ]

Work example

A database principal must be blocked from a database-level permission.

Check role membership and ownership exceptions before changing the database permission.

Check your work The test principal is blocked at database scope and retains unrelated object access.

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