SyntaxFix
Write A Post
Hire A Developer
Questions
Better yet, consider sp_getapplock which is designed for this. Or use SET LOCK_TIMEOUT
sp_getapplock
SET LOCK_TIMEOUT
Otherwise, you'd have to do something with sys.dm_tran_locks which I'd use only for DBA stuff: not for user defined concurrency.
sys.dm_tran_locks