In this case
- HOLDLOCK = SERIALIZABLE = duration, concurrency
- TABLOCKX = exclusive table lock
2 concepts are different and do not do what you want.
, , , (READPAST) (UPDLOCK) (ROWLOCK), OUTPUT, , . .
UPDATE
E
SET
[status] = 'PROCESSING', [username] = @Username
OUTPUT
INSERTED.*
FROM
(
SELECT TOP 1 id, [status], [username]
FROM Exceptions (ROWLOCK, READPAST, UPDLOCK)
WHERE [status] = 'READY'
ORDER BY id
) E
3
- = = , , (
PAGLOCK, ROWLOCK, TABLOCK) - = , concurrency (
HOLDLOCK, READCOMMITTED, REPEATABLEREAD, SERIALIZABLE) - = / (
UPDLOCK, XLOCK)