dbo.ADS_TUADSMachineInADSGroup
Database TriggerSQL_TRIGGERSandbox DB
Interpretation
- Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
- DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.
Relations
- Bulk DBQueue insert -> ADS-K-ADSMachineInADSGroup / ADS_ZADSMachineInADSGroup at line 10
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: ADSMachineInADSGroup
Typed Edges
- queues DBQueue task ADS_ZADSMachineInADSGroup at line 10 Bulk DBQueue insert -> ADS-K-ADSMachineInADSGroup / ADS_ZADSMachineInADSGroup at line 10
- trigger on table ADSMachineInADSGroup Trigger parent table: ADSMachineInADSGroup
- references source dbo.QBM_FGIBitPatternXMarkedForDel source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_FGIXOriginChanged_Except2 source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.ADS_TUADSMachine source text reference
References
- dbo.QBM_FGIBitPatternXMarkedForDel
- dbo.QBM_FGISessionContext
- dbo.QBM_FGIXOriginChanged_Except2
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.ADS_TUADSMachine
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger ADS_TUADSMachineInADSGroup2 ON ADSMachineInADSGroup FOR3UPDATE NOT FOR Replication4AS5BEGIN6 DECLARE @GenProcID varchar(38)7 DECLARE @XUser nvarchar(64)8 DECLARE @QBM_BitPatternXMarkedForDel_OutStanding int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|',9 0)10 BEGIN TRY11 IF EXISTS(12 SELECT TOP 1 113 FROM deleted)14 GOTO start15 IF EXISTS(16 SELECT TOP 1 117 FROM inserted)18 GOTO start19 RETURN start:20 SELECT @GenProcID = dbo.QBM_FGISessionContext('')21 SELECT @XUser = dbo.QBM_FGISessionContext('XUser')22 IF23 UPDATE(XOrigin) OR24 UPDATE(XIsInEffect)25 BEGIN26 IF EXISTS(27 SELECT TOP 1 128 FROM deleted d29 JOIN ADSMachineInADSGroup dd30 ON d.XObjectKey = dd.XObjectKey31 JOIN ADSGroup g32 ON d.UID_ADSGroup = g.UID_ADSGroup33 WHERE34 1 = g.HasReadOnlyMemberships AND d.XOrigin <> dd.XOrigin AND dbo.QBM_FGISessionContext('Fullsync') = '' AND EXISTS(35 SELECT TOP 1 136 FROM ADSMachine a37 WHERE38 a.UID_ADSMachine = d.UID_ADSMachine AND a.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0))39 BEGIN40 RAISERROR('#LDS#Cannot update {0} because assignment to groups with read only memberships are not permitted.|ADSMachineInADSGroup|',41 18,42 2)43 WITH nowait44 END45 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw46 INSERT INTO @DBQueueElements_01(object,47 subobject,48 genprocid)49 SELECT50 x.uid,51 NULL,52 @GenProcID53 FROM(54 SELECT55 DISTINCT d.UID_ADSMachine AS uid56 FROM deleted d57 JOIN ADSMachineInADSGroup dd58 ON d.XObjectKey = dd.XObjectKey59 WHERE60 dbo.QBM_FGIXOriginChanged_Except2(d.XOrigin, dd.XOrigin) = 1 OR(d.XIsInEffect <> dd.XIsInEffect AND dbo.QBM_FGISessionContext('Fullsync'61 ) > ' ')) AS x62 EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-ADSMachineInADSGroup',63 @DBQueueElements_0164 END65 END TRY66 BEGIN CATCH67 EXEC QBM_PSessionErrorAdd DEFAULT68 RAISERROR('',69 18,70 1)71 WITH NOWAIT72 END CATCH73 ende:74 RETURN75END
Open raw exported source
1create trigger ADS_TUADSMachineInADSGroup on ADSMachineInADSGroup for update not for Replication as begin declare @GenProcID varchar(38) declare2 @XUser nvarchar(64) declare @QBM_BitPatternXMarkedForDel_OutStanding int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|', 0) BEGIN TRY if exists3 (select top 1 1 from deleted) goto start if exists (select top 1 1 from inserted) goto start return start: select @GenProcID = dbo.QBM_FGISessionContext4('') select @XUser = dbo.QBM_FGISessionContext('XUser') if update(XOrigin) or update(XIsInEffect) begin if exists (select top 1 1 from deleted d join 5ADSMachineInADSGroup dd on d.XObjectKey = dd.XObjectKey join ADSGroup g on d.UID_ADSGroup = g.UID_ADSGroup where 1 = g.HasReadOnlyMemberships and d.XOrigin6 <> dd.XOrigin and dbo.QBM_FGISessionContext ('Fullsync') = '' and exists (select top 1 1 from ADSMachine a where a.UID_ADSMachine = d.UID_ADSMachine 7and a.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0 ) ) begin raiserror( '#LDS#Cannot update {0} because assignment to groups with read only memberships are not permitted.|ADSMachineInADSGroup|'8, 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null,9 @GenProcID from ( select distinct d.UID_ADSMachine as uid from deleted d join ADSMachineInADSGroup dd on d.XObjectKey = dd.XObjectKey where dbo.QBM_FGIXOriginChanged_Except210(d.XOrigin, dd.XOrigin) = 1 or (d.XIsInEffect <> dd.XIsInEffect and dbo.QBM_FGISessionContext ('Fullsync') > ' ' ) ) as x exec QBM_PDBQueueInsert_Bulk11 'ADS-K-ADSMachineInADSGroup', @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH12 ende: return end 13