SQL Flow Field Guide

IS_MEMBER

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

IS_MEMBER ( { 'group' | 'role' } )

Work example

Check membership in a Windows group or database role in the current database.

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

Check your work Handle null as indeterminate and separate database roles from server roles.

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