SQL Flow Field Guide

DENY Service Broker Permissions

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

DENY permissions on service broker

What changes

Input
principal and securable names
Output or change
permission metadata

Syntax at a glance

DENY permission [ ,...n ] ON { [ CONTRACT :: contract_name ] | [ MESSAGE TYPE :: message_type_name ] | [ REMOTE SERVICE BINDING :: remote_binding_name ] | [ ROUTE :: route_name ] | [ SERVICE :: service_name ] } TO database_principal [ ,...n ] [ CASCADE ] [ AS denying_principal ]

Work example

A database principal must be blocked from a Service Broker operation.

Check service, queue, contract, and database role permissions used by message handlers.

Check your work The principal cannot perform the restricted broker operation and handlers still process approved messages.

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