SQL Flow Field Guide

PERMISSIONS

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

security context lookup

What changes

Input
security context (login, user, roles, permissions)
Output or change
name, id or boolean
Return type
int

Syntax at a glance

PERMISSIONS ( [ objectid [ , 'column' ] ] )

Work example

Read the current permission bitmask for a securable in legacy code.

Test under the intended execution context. Use GRANT and DENY rather than returned identity text.

Check your work Prefer HAS_PERMS_BY_NAME for new checks and decode with the exact permission contract.

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