SQL Flow Field Guide

DENY

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

DENY permissions

What changes

Input
principal and securable names
Output or change
permission metadata

Syntax at a glance

DENY { ALL [ PRIVILEGES ] } | <permission> [ ( column [ ,...n ] ) ] [ ,...n ] [ ON [ <class> :: ] securable ] TO principal [ ,...n ] [ CASCADE] [ AS principal ] [;]

Work example

A principal must be blocked from one permission at a defined securable scope.

Review inherited grants, ownership, role membership, and privileged bypass paths before applying a denial.

Check your work The test principal fails the named operation at the intended scope.

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