SQL Flow Field Guide

APPLOCK_MODE

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

catalog lookup

What changes

Input
catalog metadata (object, column, index, file, database properties)
Output or change
id, name or property value
Return type
nvarchar(32)

Syntax at a glance

APPLOCK_MODE( 'database_principal' , 'resource_name' , 'lock_owner' )

Work example

Inspect the application lock mode held for a resource in an owner scope.

Use schema-qualified names and test missing and permission-hidden objects separately.

Check your work Use the same database, resource, principal, and owner context as the lock request.

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