1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33
|
CREATE TRIGGER TG_CBDEL_F_PAYS ON F_PAYS FOR DELETE WITH APPEND AS
SET NOCOUNT ON
IF dbo.CB_FntIsFileLock('F_PAYS',3) = 1
BEGIN
Raiserror(80004,11,1) WITH SETERROR
Rollback Transaction
Return
END
IF dbo.CB_FntIsFileLock('F_PAYS',2) = 1
BEGIN
Raiserror(80002,11,1) WITH SETERROR
Rollback Transaction
Return
END
IF dbo.CB_FntIsFileLock('F_PAYS',0) = 1
BEGIN
Raiserror(80008,11,1) WITH SETERROR
Rollback Transaction
Return
END
IF dbo.CB_FntIsFileLock('F_PAYS',1) = 1
BEGIN
Raiserror(80008,11,1) WITH SETERROR
Rollback Transaction
Return
END
IF EXISTS(SELECT 'a' FROM deleted WHERE dbo.CB_FntIsRecordLock('F_PAYS',cbMarq) = 1)
BEGIN
Raiserror(80003,11,1) WITH SETERROR
Rollback Transaction
Return
END |
Partager