SQL Flow Field Guide

SUSER_SID

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
varbinary(85)

Syntax at a glance

SUSER_SID ( [ 'login' ] [ , Param2 ] )

Work example

Read the security identifier for an existing server principal.

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

Check your work Restrict the SID to diagnostics and do not confuse it with a database user id.

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