dbo.ADS_TIADSContactInADSGroup
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-ADSContactInADSGroup / ADS_ZContactInADSGroup at line 10
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 10
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 10
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 13
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 13
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 16
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: ADSContactInADSGroup
Typed Edges
- queues DBQueue task ADS_ZContactInADSGroup at line 10 Bulk DBQueue insert -> ADS-K-ADSContactInADSGroup / ADS_ZContactInADSGroup at line 10
- queues DBQueue task ADS_ZPersonHasObject at line 10 Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 10
- queues DBQueue task ADS_ZPersonHasObject at line 13 Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 13
- queues DBQueue task ADS_ZPersonHasObject at line 16 Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 16
- trigger on table ADSContactInADSGroup Trigger parent table: ADSContactInADSGroup
- references source dbo.QBM_FGIBitPatternXOrigin source text reference
- references source dbo.QBM_FGIConfigparmValue source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QER_FGIITShopFlagCombineValid source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.ADS_TIADSContact source text reference
References
- dbo.QBM_FGIBitPatternXOrigin
- dbo.QBM_FGIConfigparmValue
- dbo.QBM_FGISessionContext
- dbo.QER_FGIITShopFlagCombineValid
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.ADS_TIADSContact
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger ADS_TIADSContactInADSGroup2 ON ADSContactInADSGroup FOR3INSERT NOT FOR Replication4AS5BEGIN6 DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',7 0)8 DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',9 1)10 BEGIN TRY11 IF EXISTS(12 SELECT TOP 1 113 FROM inserted)14 GOTO start15 RETURN start:16 DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')17 DECLARE @XUser nvarchar(64) = dbo.QBM_FGISessionContext('XUser')18 IF EXISTS(19 SELECT TOP 1 120 FROM inserted i21 JOIN ADSGroup elem22 ON i.uid_ADSGroup = elem.uid_ADSGroup23 WHERE24 dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct25 > 0 AND dbo.QBM_FGISessionContext('Fullsync') = '')26 BEGIN27 RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',28 18,29 2)30 WITH nowait31 END32 IF EXISTS(33 SELECT TOP 1 134 FROM inserted i35 JOIN ADSGroup g36 ON i.UID_ADSGroup = g.UID_ADSGroup AND 1 = g.HasReadOnlyMemberships AND dbo.QBM_FGISessionContext('Fullsync') = '')37 BEGIN38 RAISERROR('#LDS#Cannot add {0} because assignment to groups with read only memberships are not permitted.|ADSContactInADSGroup|',39 18,40 2)41 WITH nowait42 END43 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw44 INSERT INTO @DBQueueElements_01(object,45 subobject,46 genprocid)47 SELECT48 x.uid,49 NULL,50 @GenProcID51 FROM(52 SELECT53 DISTINCT i.UID_ADSContact AS uid54 FROM inserted i55 WHERE56 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x57 EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-ADSContactInADSGroup',58 @DBQueueElements_0159 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw60 INSERT INTO @DBQueueElements_02(object,61 subobject,62 genprocid)63 SELECT64 x.uid,65 NULL,66 @GenProcID67 FROM(68 SELECT69 DISTINCT u.UID_Person AS uid70 FROM inserted i71 JOIN ADSContact u72 ON i.UID_ADSContact = u.UID_ADSContact73 WHERE74 u.UID_Person > ' ' AND i.XIsInEffect = 1) AS x75 EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject',76 @DBQueueElements_0277 IF '1' = dbo.QBM_FGIConfigparmValue('QER\ComplianceCheck\IncludeTSBPersonUsesAccount')78 BEGIN79 DECLARE @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw80 INSERT INTO @DBQueueElements_PersonUsesAccount(object,81 subobject,82 genprocid)83 SELECT84 x.uid,85 NULL,86 @GenProcID87 FROM(88 SELECT89 DISTINCT t.uid_person AS uid90 FROM inserted i91 JOIN ADSContact a92 ON i.UID_ADSContact = a.UID_ADSContact93 JOIN TSBPersonUsesAccount t94 ON a.XObjectKey = t.ObjectKeyAccount95 WHERE96 i.XIsInEffect = 1) AS x97 EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject',98 @DBQueueElements_PersonUsesAccount99 END100 END TRY101 BEGIN CATCH102 EXEC QBM_PSessionErrorAdd DEFAULT103 RAISERROR('',104 18,105 1)106 WITH NOWAIT107 END CATCH108 ende:109 RETURN110END
Open raw exported source
1 create trigger ADS_TIADSContactInADSGroup on ADSContactInADSGroup for Insert not for Replication as begin declare @QBM_BitPatternXOrigin_Direct2 int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1) BEGIN3 TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) = dbo.QBM_FGISessionContext('') declare @XUser nvarchar4(64) = dbo.QBM_FGISessionContext('XUser') if exists (select top 1 1 from inserted i join ADSGroup elem on i.uid_ADSGroup = elem.uid_ADSGroup where dbo.QER_FGIITShopFlagCombineValid5(i.XObjectKey, null, null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 and dbo.QBM_FGISessionContext6 ('Fullsync') = '' ) begin raiserror ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|', 18, 2) with nowait end if exists 7(select top 1 1 from inserted i join ADSGroup g on i.UID_ADSGroup = g.UID_ADSGroup and 1 = g.HasReadOnlyMemberships and dbo.QBM_FGISessionContext ('Fullsync'8) = '' ) begin raiserror( '#LDS#Cannot add {0} because assignment to groups with read only memberships are not permitted.|ADSContactInADSGroup|', 18, 29) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID10 from ( select distinct i.UID_ADSContact as uid from inserted i where i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk11 'ADS-K-ADSContactInADSGroup', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid12) select x.uid, null, @GenProcID from ( select distinct u.UID_Person as uid from inserted i join ADSContact u on i.UID_ADSContact = u.UID_ADSContact where13 u.UID_Person > ' ' and i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject', @DBQueueElements_02 if '1' = dbo.QBM_FGIConfigparmValue14('QER\ComplianceCheck\IncludeTSBPersonUsesAccount') begin declare @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw insert into @DBQueueElements_PersonUsesAccount15 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct t.uid_person as uid from inserted i join ADSContact a on i.UID_ADSContact16 = a.UID_ADSContact join TSBPersonUsesAccount t on a.XObjectKey = t.ObjectKeyAccount where i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject'17, @DBQueueElements_PersonUsesAccount end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return18 end 19