SQL Flow Field Guide

LOGINPROPERTY

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

Syntax at a glance

LOGINPROPERTY ( 'login_name' , 'property_name' )

Work example

Inspect a documented SQL Server login property for administration review.

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

Check your work Restrict output because login policy and lockout metadata are sensitive.

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