dbo.LDP_TULDAPAccountInLDAPGroup
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 -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 10
- Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 10
- Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 10
- Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 15
- Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 15
- Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 20
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: LDAPAccountInLDAPGroup
Typed Edges
- queues DBQueue task LDP_ZAccountInLDAPGroup at line 10 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 10
- queues DBQueue task LDP_ZPersonHasObject at line 10 Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 10
- queues DBQueue task LDP_ZPersonHasObject at line 15 Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 15
- queues DBQueue task LDP_ZPersonHasObject at line 20 Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 20
- trigger on table LDAPAccountInLDAPGroup Trigger parent table: LDAPAccountInLDAPGroup
- references source dbo.QBM_FGIBitPatternXMarkedForDel source text reference
- references source dbo.QBM_FGIConfigparmValue source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_FGIXOriginChanged_Effect source text reference
- references source dbo.QBM_FGIXOriginChanged_Except2 source text reference
- references source dbo.QER_FCVXOriginToInheritInfo source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.LDP_TULDAPAccount source text reference
References
- dbo.QBM_FGIBitPatternXMarkedForDel
- dbo.QBM_FGIConfigparmValue
- dbo.QBM_FGISessionContext
- dbo.QBM_FGIXOriginChanged_Effect
- dbo.QBM_FGIXOriginChanged_Except2
- dbo.QER_FCVXOriginToInheritInfo
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.LDP_TULDAPAccount
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger LDP_TULDAPAccountInLDAPGroup2 ON LDAPAccountInLDAPGroup 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 inserted)14 GOTO start15 IF EXISTS(16 SELECT TOP 1 117 FROM deleted)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 LDAPAccountInLDAPGroup dd30 ON d.XObjectKey = dd.XObjectKey31 JOIN LDAPGroup g32 ON d.UID_LDAPGroup = g.uid_LDAPGroup33 WHERE34 g.IsDynamicGroup = 1 AND d.XOrigin <> dd.XOrigin AND dbo.QBM_FGISessionContext('Fullsync') = '' AND EXISTS(35 SELECT TOP 1 136 FROM LDAPAccount a37 WHERE38 a.UID_LDAPAccount = d.UID_LDAPAccount AND a.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0))39 BEGIN40 RAISERROR('#LDS#Cannot update {0} because it is assignments for dynamic groups.|LDAPAccountInLDAPGroup|',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_LDAPAccount AS uid56 FROM deleted d57 JOIN LDAPAccountInLDAPGroup 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 'LDP-K-LDAPAccountInLDAPGroup',63 @DBQueueElements_0164 END65 IF66 UPDATE(XIsInEffect) OR67 UPDATE(XOrigin)68 BEGIN69 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw70 INSERT INTO @DBQueueElements_02(object,71 subobject,72 genprocid)73 SELECT74 x.uid,75 NULL,76 @GenProcID77 FROM(78 SELECT79 DISTINCT x.UID_Person AS uid80 FROM LDAPAccountInLDAPGroup a81 JOIN deleted d82 ON a.XObjectKey = d.XObjectKey83 JOIN LDAPAccount x84 ON a.UID_LDAPAccount = x.UID_LDAPAccount85 WHERE86 x.UID_Person > ' ' AND(dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 OR dbo.QER_FCVXOriginToInheritInfo87 (d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin))) AS x88 EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-PersonHasObject',89 @DBQueueElements_0290 IF '1' = dbo.QBM_FGIConfigparmValue('QER\ComplianceCheck\IncludeTSBPersonUsesAccount')91 BEGIN92 DECLARE @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw93 INSERT INTO @DBQueueElements_PersonUsesAccount(object,94 subobject,95 genprocid)96 SELECT97 x.uid,98 NULL,99 @GenProcID100 FROM(101 SELECT102 DISTINCT t.uid_person AS uid103 FROM LDAPAccountInLDAPGroup aig104 JOIN deleted d105 ON aig.XObjectKey = d.XObjectKey106 JOIN LDAPAccount a107 ON aig.UID_LDAPAccount = a.UID_LDAPAccount108 JOIN TSBPersonUsesAccount t109 ON a.XObjectKey = t.ObjectKeyAccount110 WHERE111 (dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, aig.XOrigin, d.XIsInEffect, aig.XIsInEffect) = 1 OR dbo.QER_FCVXOriginToInheritInfo(d.XOrigin112 ) <> dbo.QER_FCVXOriginToInheritInfo(aig.XOrigin))) AS x113 EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-PersonHasObject',114 @DBQueueElements_PersonUsesAccount115 END116 END117 END TRY118 BEGIN CATCH119 EXEC QBM_PSessionErrorAdd DEFAULT120 RAISERROR('',121 18,122 1)123 WITH NOWAIT124 END CATCH125 ende:126 RETURN127END
Open raw exported source
1create trigger LDP_TULDAPAccountInLDAPGroup on LDAPAccountInLDAPGroup for Update not for Replication as begin declare @GenProcID varchar(38)2 declare @XUser nvarchar(64) declare @QBM_BitPatternXMarkedForDel_OutStanding int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|', 0) BEGIN TRY if3 exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) 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 5LDAPAccountInLDAPGroup dd on d.XObjectKey = dd.XObjectKey join LDAPGroup g on d.UID_LDAPGroup = g.uid_LDAPGroup where g.IsDynamicGroup = 1 and d.XOrigin6 <> dd.XOrigin and dbo.QBM_FGISessionContext ('Fullsync') = '' and exists (select top 1 1 from LDAPAccount a where a.UID_LDAPAccount = d.UID_LDAPAccount7 and a.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0 ) ) begin raiserror( '#LDS#Cannot update {0} because it is assignments for dynamic groups.|LDAPAccountInLDAPGroup|'8, 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null9, @GenProcID from ( select distinct d.UID_LDAPAccount as uid from deleted d join LDAPAccountInLDAPGroup 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 'LDP-K-LDAPAccountInLDAPGroup', @DBQueueElements_01 end if update(XIsInEffect) or update(XOrigin) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert12 into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct x.UID_Person as uid from LDAPAccountInLDAPGroup13 a join deleted d on a.XObjectKey = d.XObjectKey join LDAPAccount x on a.UID_LDAPAccount = x.UID_LDAPAccount where x.UID_Person > ' ' and ( dbo.QBM_FGIXOriginChanged_Effect14(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin) ) 15) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-PersonHasObject', @DBQueueElements_02 if '1' = dbo.QBM_FGIConfigparmValue('QER\ComplianceCheck\IncludeTSBPersonUsesAccount'16) begin declare @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw insert into @DBQueueElements_PersonUsesAccount (object, subobject, genprocid) select17 x.uid, null, @GenProcID from ( select distinct t.uid_person as uid from LDAPAccountInLDAPGroup aig join deleted d on aig.XObjectKey = d.XObjectKey join18 LDAPAccount a on aig.UID_LDAPAccount = a.UID_LDAPAccount join TSBPersonUsesAccount t on a.XObjectKey = t.ObjectKeyAccount where ( dbo.QBM_FGIXOriginChanged_Effect19(d.XOrigin, aig.XOrigin, d.XIsInEffect, aig.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(aig.XOrigin20) ) ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-PersonHasObject', @DBQueueElements_PersonUsesAccount end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd21 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 22