You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
ALTER PROCEDURE [dbo].[CB_IsRecordLock] @cbFile sysname, @cbMarq as int, @lRes int OUTPUT AS
BEGIN
IF (SESSION_CONTEXT(N'cbLockBypass') = 1) --Bypass all locks
BEGIN
SET @lRes = 0;
END
ELSE IF (SESSION_CONTEXT(N'cbLockBypass') = 2 --Bypass own locks only
AND NOT EXISTS(SELECT 1 FROM cbLock WHERE cbDb = IsNull(DB_ID(),0) AND cbFile = IsNull(OBJECT_ID(@cbFile),0) AND cbMarq = IsNull(@cbMarq,0) AND SystemUser <> SUSER_NAME()))
BEGIN
SET @lRes = 0;
END
ELSE IF (NOT EXISTS(SELECT 1 FROM cbLock WHERE cbDb = IsNull(DB_ID(),0) AND cbFile = IsNull(OBJECT_ID(@cbFile),0) AND cbMarq = IsNull(@cbMarq,0) AND cbSPID <> @@SPID))