APPLOCK_TEST
catalog lookup
What changes
- Input
- catalog metadata (object, column, index, file, database properties)
- Output or change
- id, name or property value
- Return type
- smallint
Syntax at a glance
APPLOCK_TEST ( 'database_principal' , 'resource_name' , 'lock_mode' , 'lock_owner' )
Work example
Check whether an application lock request would be granted for a selected mode.
Use schema-qualified names and test missing and permission-hidden objects separately.
Check your work The result is a point-in-time check and can change before a later lock request.
Open Microsoft Learn for full syntax, permissions, and details for your version.