dbo.LDP_TULDAPGroup
Database TriggerSQL_TRIGGERSandbox DB
Interpretation
- Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
- Object-layer bridge detected through QBM_PJobCreate helper usage.
- 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 60
- References QBM_PJobCreate*
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: LDAPGroup
Typed Edges
- queues DBQueue task LDP_ZAccountInLDAPGroup at line 60 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 60
- trigger on table LDAPGroup Trigger parent table: LDAPGroup
- references source dbo.QBM_FCVBigIntToString source text reference
- references source dbo.QBM_FGIBitPatternXMarkedForDel source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PJobCreate source text reference
- references source dbo.QBM_PJobCreate_HOUpdate source text reference
- references source dbo.QBM_PJobCreate_HOUpdate_B source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.QER_PIsForITShopFlagCheck source text reference
- references source dbo.QER_PITShopHelperFill source text reference
- references source dbo.QER_PITShopHelperFill_Recalc source text reference
References
- dbo.QBM_FCVBigIntToString
- dbo.QBM_FGIBitPatternXMarkedForDel
- dbo.QBM_FGISessionContext
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PJobCreate
- dbo.QBM_PJobCreate_HOUpdate
- dbo.QBM_PJobCreate_HOUpdate_B
- dbo.QBM_PSessionErrorAdd
- dbo.QER_PIsForITShopFlagCheck
- dbo.QER_PITShopHelperFill
- dbo.QER_PITShopHelperFill_Recalc
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger LDP_TULDAPGroup2 ON LDAPGroup FOR3UPDATE NOT FOR Replication4AS5BEGIN6 DECLARE @Parameter nvarchar(256)7 DECLARE @ObjectkeyOrdered varchar(138)8 DECLARE @UID_AccProduct varchar(38)9 DECLARE @whereclauseOrg nvarchar(max)10 DECLARE @whereclauseMuster nvarchar(max) = ' UID_ITShopOrg in ( select UID_OrgPR 11 from QER_VPWOProductNodesSlim12 where ObjectkeyOrdered = ''@ObjectkeyOrdered'' 13 and isnull(UID_AccProduct, '''') <> ''@UID_AccProduct''14 )15'16 DECLARE @ElementBuffer QBM_YCursorBuffer17 DECLARE @ElementCount int18 DECLARE @ElementIndex int19 DECLARE @QBM_BitPatternXMarkedForDel_Out int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|',20 0)21 BEGIN TRY22 IF EXISTS(23 SELECT TOP 1 124 FROM inserted)25 GOTO start26 IF EXISTS(27 SELECT TOP 1 128 FROM deleted)29 GOTO start30 RETURN start:31 DECLARE @GenProcID varchar(38)32 SELECT @GenProcID = dbo.QBM_FGISessionContext('')33 IF34 UPDATE(isForITShop) OR35 UPDATE(isITShopOnly)36 BEGIN37 DECLARE @FlagTest QBM_YParameterlist38 INSERT INTO @FlagTest(Parameter1,39 Parameter2,40 HasContentFull,41 e.Parameter3)42 SELECT43 i.UID_LDAPGroup,44 i.XObjectKey,45 i.IsForITShop,46 dbo.QBM_FCVBigIntToString(i.IsITShopOnly)47 FROM inserted i48 EXEC QER_PIsForITShopFlagCheck 'LDAPGroup',49 @FlagTest,50 'LDAPAccountInLDAPGroup|LDPMachineInLDAPGroup'51 END52 IF53 UPDATE(IsDynamicGroup)54 BEGIN55 IF EXISTS(56 SELECT TOP 1 157 FROM deleted d58 JOIN LDAPGroup g59 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 160 JOIN LDAPGroupExclusion bhg61 ON g.uid_LDAPGroup = bhg.uid_LDAPGroupLower) OR EXISTS(62 SELECT TOP 1 163 FROM deleted d64 JOIN LDAPGroup g65 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 166 JOIN LDAPGroupExclusion bhg67 ON g.uid_LDAPGroup = bhg.uid_LDAPGroupHigher)68 BEGIN69 IF dbo.QBM_FGISessionContext('Fullsync') > ' '70 BEGIN71 DELETE LDAPGroupExclusion72 FROM deleted d73 JOIN LDAPGroup g74 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 175 JOIN LDAPGroupExclusion bhg76 ON g.uid_LDAPGroup IN(bhg.uid_LDAPGroupHigher,77 bhg.UID_LDAPGroupLower)78 END79 ELSE80 BEGIN81 RAISERROR('#LDS#Changes can not be made because there are still assignments in group exclusion.|',82 18,83 2)84 WITH nowait85 END86 END87 IF EXISTS(88 SELECT TOP 1 189 FROM deleted d90 JOIN LDAPGroup g91 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 192 JOIN LDPMachineInLDAPGroup bhg93 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup AND bhg.XOrigin > 0)94 BEGIN95 IF dbo.QBM_FGISessionContext('Fullsync') > ' '96 BEGIN97 UPDATE LDPMachineInLDAPGroup98 SET XOrigin = 0,99 XIsInEffect = 0100 FROM deleted d101 JOIN LDAPGroup g102 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1103 JOIN LDPMachineInLDAPGroup bhg104 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup105 END106 ELSE107 BEGIN108 RAISERROR('#LDS#Changes cannot be made because assignment still exist for {0}.|LDPMachine|',109 18,110 1)111 WITH nowait112 END113 END114 IF EXISTS(115 SELECT TOP 1 1116 FROM deleted d117 JOIN LDAPGroup g118 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1119 JOIN BaseTreeHasLDAPGroup bhg120 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup AND bhg.XOrigin > 0)121 BEGIN122 IF dbo.QBM_FGISessionContext('Fullsync') > ' '123 BEGIN124 UPDATE BaseTreeHasLDAPGroup125 SET XOrigin = 0,126 XIsInEffect = 0127 FROM deleted d128 JOIN LDAPGroup g129 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1130 JOIN BaseTreeHasLDAPGroup bhg131 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup132 END133 ELSE134 BEGIN135 RAISERROR('#LDS#Changes cannot be made because assignment still exist for {0}.|BaseTree|',136 18,137 1)138 WITH nowait139 END140 END141 IF EXISTS(142 SELECT TOP 1 1143 FROM deleted d144 JOIN LDAPGroup g145 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1146 JOIN LDAPAccountInLDAPGroup bhg147 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup AND bhg.XOrigin > 0)148 BEGIN149 IF dbo.QBM_FGISessionContext('Fullsync') > ' '150 BEGIN151 UPDATE LDAPAccountInLDAPGroup152 SET XOrigin = 0,153 XIsInEffect = 0154 FROM deleted d155 JOIN LDAPGroup g156 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1157 JOIN LDAPAccountInLDAPGroup bhg158 ON g.uid_LDAPGroup = bhg.uid_LDAPGroup159 END160 ELSE161 BEGIN162 RAISERROR('#LDS#Changes cannot be made because assignment still exist for {0}.|LDAPAccount|',163 18,164 1)165 WITH nowait166 END167 END168 IF EXISTS(169 SELECT TOP 1 1170 FROM deleted d171 JOIN LDAPGroup g172 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1173 JOIN EsetHasEntitlement bhg174 ON g.XObjectKey = bhg.Entitlement AND bhg.XOrigin > 0)175 BEGIN176 IF dbo.QBM_FGISessionContext('Fullsync') > ' '177 BEGIN178 UPDATE EsetHasEntitlement179 SET XOrigin = 0,180 XIsInEffect = 0181 FROM deleted d182 JOIN LDAPGroup g183 ON d.uid_LDAPGroup = g.uid_LDAPGroup AND d.IsDynamicGroup = 0 AND g.IsDynamicGroup = 1184 JOIN EsetHasEntitlement bhg185 ON g.XObjectKey = bhg.Entitlement186 END187 ELSE188 BEGIN189 RAISERROR('#LDS#Changes cannot be made because assignment still exist for {0}.|Eset|',190 18,191 1)192 WITH nowait193 END194 END195 END196 IF197 UPDATE(uid_accproduct)198 BEGIN199 INSERT INTO @ElementBuffer(ObjectKey1,200 UID1)201 SELECT202 x.XObjectKey,203 isnull(x.uid_accproduct,204 '')205 FROM LDAPGroup x206 JOIN deleted d207 ON x.uid_LDAPGroup = d.uid_LDAPGroup AND isnull(x.uid_accproduct,208 '') <> isnull(d.uid_accproduct,209 '') AND d.uid_accproduct > ' '210 JOIN dialogColumn c211 ON c.UID_DialogTable = 'QER-T-ITShopOrg' AND c.columnname = 'uid_ACCProduct' AND c.IsDeactivatedByPreProcessor = 0212 SELECT @ElementCount = @@rowcount213 SELECT @ElementIndex = 1214 WHILE @ElementIndex <= @ElementCount215 BEGIN216 SELECT217 TOP 1 @ObjectkeyOrdered = bu.ObjectKey1,218 @UID_AccProduct = bu.UID1219 FROM @ElementBuffer bu220 WHERE221 bu.ElementIndex = @ElementIndex222 SELECT @whereclauseOrg = @whereclauseMuster223 SELECT224 @whereclauseOrg = replace(@whereclauseOrg,225 N '@ObjectkeyOrdered',226 @ObjectkeyOrdered)227 SELECT228 @whereclauseOrg = replace(@whereclauseOrg,229 N '@uid_accproduct',230 rtrim(@uid_accproduct))231 EXEC QBM_PJobCreate_HOUpdate_B 'ITShopOrg',232 @whereclauseOrg,233 @GenProcID,234 @p1 = 'uid_ACCProduct',235 @v1 = @uid_accproduct,236 @AdditionalObjectKeysAffected = DEFAULT237 SELECT @ElementIndex += 1238 END239 END240 IF241 UPDATE(UID_AccProduct)242 BEGIN243 DECLARE @RecalcParameter_OA QBM_YCursorBuffer244 INSERT INTO @RecalcParameter_OA(UID1,245 ObjectKey1,246 Ident1)247 SELECT248 'QER-PWODecisionRule-OA',249 a.XObjectKey,250 'I'251 FROM inserted i252 JOIN LDAPGroup g253 ON i.UID_LDAPGroup = g.UID_LDAPGroup254 JOIN QERAccProductUsage u255 ON g.XObjectKey = u.XObjectKey256 JOIN AccProduct a257 ON u.UID_AccProduct = a.UID_AccProduct258 UNION259 SELECT260 'QER-PWODecisionRule-OA',261 a.XObjectKey,262 'I'263 FROM deleted d264 JOIN LDAPGroup g265 ON d.UID_LDAPGroup = g.UID_LDAPGroup266 JOIN QERAccProductUsage u267 ON g.XObjectKey = u.XObjectKey268 JOIN AccProduct a269 ON u.UID_AccProduct = a.UID_AccProduct270 EXEC QER_PITShopHelperFill_Recalc @RecalcParameter_OA,271 @GenprocID272 DECLARE @RecalcParameter_OA2 QBM_YCursorBuffer273 INSERT INTO @RecalcParameter_OA2(UID1,274 ObjectKey1,275 Ident1)276 SELECT277 'QER-PWODecisionRule-OA',278 pwo.XObjectKey,279 'I'280 FROM inserted i281 JOIN LDAPGroup g282 ON i.UID_LDAPGroup = g.UID_LDAPGroup283 JOIN AccProduct a284 ON i.UID_AccProduct = a.UID_AccProduct285 JOIN PersonWantsOrg pwo286 ON g.XObjectKey = pwo.ObjectKeyElementUsedInAssign287 UNION288 SELECT289 'QER-PWODecisionRule-OA',290 pwo.XObjectKey,291 'I'292 FROM deleted d293 JOIN LDAPGroup g294 ON d.UID_LDAPGroup = g.UID_LDAPGroup295 JOIN AccProduct a296 ON d.UID_AccProduct = a.UID_AccProduct297 JOIN PersonWantsOrg pwo298 ON g.XObjectKey = pwo.ObjectKeyElementUsedInAssign299 EXEC QER_PITShopHelperFill_Recalc @RecalcParameter_OA2,300 @GenprocID301 END302 IF303 UPDATE(MatchPatternForMembership) OR304 UPDATE(XMarkedForDeletion)305 BEGIN306 DECLARE @GroupsChanged QBM_YParameterList307 INSERT INTO @GroupsChanged(Parameter1,308 Parameter2)309 SELECT310 g.uid_LDAPGroup AS uid,311 g.XObjectKey312 FROM LDAPGroup g313 JOIN deleted d314 ON g.UID_LDAPGroup = d.UID_LDAPGroup AND(g.MatchPatternForMembership <> d.MatchPatternForMembership OR(g.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_Out315 = 0 AND d.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_Out > 0))316 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw317 INSERT INTO @DBQueueElements_01(object,318 subobject,319 genprocid)320 SELECT321 x.uid,322 NULL,323 @GenProcID324 FROM(325 SELECT aig.UID_LDAPAccount AS uid326 FROM @GroupsChanged g327 JOIN LDAPAccountInLDAPGroup aig328 ON g.Parameter1 = aig.UID_LDAPAccount AND aig.XOrigin > 0329 UNION330 SELECT u.UID_LDAPAccount AS uid331 FROM @GroupsChanged g332 JOIN BaseTreeHasObject bho333 ON g.Parameter2 = bho.ObjectKey334 JOIN PersonInBaseTree pho335 ON bho.UID_Org = pho.UID_Org336 JOIN LDAPAccount u337 ON u.UID_Person = pho.UID_Person338 UNION339 SELECT u.UID_LDAPAccount AS uid340 FROM @GroupsChanged g341 JOIN BaseTreeHasObject bho342 ON g.Parameter2 = bho.ObjectKey343 JOIN HelperPersonOrg pho344 ON bho.UID_Org = pho.UID_Org345 JOIN LDAPAccount u346 ON u.UID_Person = pho.UID_Person347 UNION348 SELECT u.UID_LDAPAccount AS uid349 FROM @GroupsChanged g350 JOIN ESetHasEntitlement ehe351 ON g.Parameter2 = ehe.Entitlement352 JOIN PersonHasESet phe353 ON phe.UID_ESet = ehe.UID_ESet354 JOIN LDAPAccount u355 ON u.UID_Person = phe.UID_Person) AS x356 EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup',357 @DBQueueElements_01358 END359 END TRY360 BEGIN CATCH361 EXEC QBM_PSessionErrorAdd DEFAULT362 RAISERROR('',363 18,364 1)365 WITH NOWAIT366 END CATCH367 ende:368 RETURN369END
Open raw exported source
1create trigger LDP_TULDAPGroup on LDAPGroup for Update not for Replication as begin declare @Parameter nvarchar(256) declare @ObjectkeyOrdered2 varchar(138) declare @UID_AccProduct varchar(38) declare @whereclauseOrg nvarchar(max) declare @whereclauseMuster nvarchar(max) = ' UID_ITShopOrg in ( select UID_OrgPR 3 from QER_VPWOProductNodesSlim4 where ObjectkeyOrdered = ''@ObjectkeyOrdered'' 5 and isnull(UID_AccProduct, '''') <> ''@UID_AccProduct''6 )7'8 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @QBM_BitPatternXMarkedForDel_Out int = dbo.QBM_FGIBitPatternXMarkedForDel9('|OutStanding|', 0) BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare10 @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(isForITShop) or update(isITShopOnly) begin declare @FlagTest QBM_YParameterlist11 insert into @FlagTest(Parameter1, Parameter2, HasContentFull, e.Parameter3) select i.UID_LDAPGroup, i.XObjectKey, i.IsForITShop, dbo.QBM_FCVBigIntToString12(i.IsITShopOnly) from inserted i exec QER_PIsForITShopFlagCheck 'LDAPGroup', @FlagTest, 'LDAPAccountInLDAPGroup|LDPMachineInLDAPGroup' end if update(IsDynamicGroup13) begin if exists (select top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and g.IsDynamicGroup =14 1 join LDAPGroupExclusion bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroupLower ) or exists (select top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup15 = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and g.IsDynamicGroup = 1 join LDAPGroupExclusion bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroupHigher ) begin 16if dbo.QBM_FGISessionContext ('Fullsync') > ' ' begin delete LDAPGroupExclusion from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and17 d.IsDynamicGroup = 0 and g.IsDynamicGroup = 1 join LDAPGroupExclusion bhg on g.uid_LDAPGroup in( bhg.uid_LDAPGroupHigher, bhg.UID_LDAPGroupLower) end 18else begin raiserror( '#LDS#Changes can not be made because there are still assignments in group exclusion.|', 18, 2) with nowait end end if exists (select19 top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and g.IsDynamicGroup = 1 join LDPMachineInLDAPGroup20 bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup and bhg.XOrigin > 0 ) begin if dbo.QBM_FGISessionContext ('Fullsync') > ' ' begin update LDPMachineInLDAPGroup21 set XOrigin = 0 , XIsInEffect = 0 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and g.IsDynamicGroup =22 1 join LDPMachineInLDAPGroup bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup end else begin raiserror( '#LDS#Changes cannot be made because assignment still exist for {0}.|LDPMachine|'23, 18, 1) with nowait end end if exists (select top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and24 g.IsDynamicGroup = 1 join BaseTreeHasLDAPGroup bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup and bhg.XOrigin > 0 ) begin if dbo.QBM_FGISessionContext (25'Fullsync') > ' ' begin update BaseTreeHasLDAPGroup set XOrigin = 0 , XIsInEffect = 0 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup26 and d.IsDynamicGroup = 0 and g.IsDynamicGroup = 1 join BaseTreeHasLDAPGroup bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup end else begin raiserror( '#LDS#Changes cannot be made because assignment still exist for {0}.|BaseTree|'27, 18, 1) with nowait end end if exists (select top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and28 g.IsDynamicGroup = 1 join LDAPAccountInLDAPGroup bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup and bhg.XOrigin > 0 ) begin if dbo.QBM_FGISessionContext29 ('Fullsync') > ' ' begin update LDAPAccountInLDAPGroup set XOrigin = 0 , XIsInEffect = 0 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup30 and d.IsDynamicGroup = 0 and g.IsDynamicGroup = 1 join LDAPAccountInLDAPGroup bhg on g.uid_LDAPGroup = bhg.uid_LDAPGroup end else begin raiserror( '#LDS#Changes cannot be made because assignment still exist for {0}.|LDAPAccount|'31, 18, 1) with nowait end end if exists (select top 1 1 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup = 0 and32 g.IsDynamicGroup = 1 join EsetHasEntitlement bhg on g.XObjectKey = bhg.Entitlement and bhg.XOrigin > 0 ) begin if dbo.QBM_FGISessionContext ('Fullsync'33) > ' ' begin update EsetHasEntitlement set XOrigin = 0 , XIsInEffect = 0 from deleted d join LDAPGroup g on d.uid_LDAPGroup = g.uid_LDAPGroup and d.IsDynamicGroup34 = 0 and g.IsDynamicGroup = 1 join EsetHasEntitlement bhg on g.XObjectKey = bhg.Entitlement end else begin raiserror( '#LDS#Changes cannot be made because assignment still exist for {0}.|Eset|'35, 18, 1) with nowait end end end if update(uid_accproduct) begin insert into @ElementBuffer(ObjectKey1, UID1) select x.XObjectKey, isnull(x.uid_accproduct36,'') from LDAPGroup x join deleted d on x.uid_LDAPGroup = d.uid_LDAPGroup and isnull(x.uid_accproduct,'') <> isnull(d.uid_accproduct,'') and d.uid_accproduct37 > ' ' join dialogColumn c on c.UID_DialogTable = 'QER-T-ITShopOrg' and c.columnname = 'uid_ACCProduct' and c.IsDeactivatedByPreProcessor = 0 select 38@ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @ObjectkeyOrdered = bu.ObjectKey1 , @UID_AccProduct39 = bu.UID1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @whereclauseOrg = @whereclauseMuster select @whereclauseOrg = replace(@whereclauseOrg40, N'@ObjectkeyOrdered' , @ObjectkeyOrdered) select @whereclauseOrg = replace(@whereclauseOrg, N'@uid_accproduct' , rtrim(@uid_accproduct)) exec QBM_PJobCreate_HOUpdate_B41 'ITShopOrg', @whereclauseOrg, @GenProcID , @p1 = 'uid_ACCProduct', @v1 = @uid_accproduct , @AdditionalObjectKeysAffected = DEFAULT select @ElementIndex42 += 1 end end if update (UID_AccProduct) begin declare @RecalcParameter_OA QBM_YCursorBuffer insert into @RecalcParameter_OA (UID1, ObjectKey1, Ident143) select 'QER-PWODecisionRule-OA', a.XObjectKey, 'I' from inserted i join LDAPGroup g on i.UID_LDAPGroup = g.UID_LDAPGroup join QERAccProductUsage u on44 g.XObjectKey = u.XObjectKey join AccProduct a on u.UID_AccProduct = a.UID_AccProduct union select 'QER-PWODecisionRule-OA', a.XObjectKey, 'I' from deleted45 d join LDAPGroup g on d.UID_LDAPGroup = g.UID_LDAPGroup join QERAccProductUsage u on g.XObjectKey = u.XObjectKey join AccProduct a on u.UID_AccProduct46 = a.UID_AccProduct exec QER_PITShopHelperFill_Recalc @RecalcParameter_OA, @GenprocID declare @RecalcParameter_OA2 QBM_YCursorBuffer insert into @RecalcParameter_OA247 (UID1, ObjectKey1, Ident1) select 'QER-PWODecisionRule-OA', pwo.XObjectKey, 'I' from inserted i join LDAPGroup g on i.UID_LDAPGroup = g.UID_LDAPGroup 48join AccProduct a on i.UID_AccProduct = a.UID_AccProduct join PersonWantsOrg pwo on g.XObjectKey = pwo.ObjectKeyElementUsedInAssign union select 'QER-PWODecisionRule-OA'49, pwo.XObjectKey, 'I' from deleted d join LDAPGroup g on d.UID_LDAPGroup = g.UID_LDAPGroup join AccProduct a on d.UID_AccProduct = a.UID_AccProduct join50 PersonWantsOrg pwo on g.XObjectKey = pwo.ObjectKeyElementUsedInAssign exec QER_PITShopHelperFill_Recalc @RecalcParameter_OA2, @GenprocID end if update51(MatchPatternForMembership) or update(XMarkedForDeletion) begin declare @GroupsChanged QBM_YParameterList insert into @GroupsChanged (Parameter1, Parameter252) select g.uid_LDAPGroup as uid, g.XObjectKey from LDAPGroup g join deleted d on g.UID_LDAPGroup = d.UID_LDAPGroup and ( g.MatchPatternForMembership <>53 d.MatchPatternForMembership or (g.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_Out = 0 and d.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_Out54 > 0 ) ) declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from55 ( select aig.UID_LDAPAccount as uid from @GroupsChanged g join LDAPAccountInLDAPGroup aig on g.Parameter1 = aig.UID_LDAPAccount and aig.XOrigin > 0 56union select u.UID_LDAPAccount as uid from @GroupsChanged g join BaseTreeHasObject bho on g.Parameter2 = bho.ObjectKey join PersonInBaseTree pho on bho.UID_Org57 = pho.UID_Org join LDAPAccount u on u.UID_Person = pho.UID_Person union select u.UID_LDAPAccount as uid from @GroupsChanged g join BaseTreeHasObject bho58 on g.Parameter2 = bho.ObjectKey join HelperPersonOrg pho on bho.UID_Org = pho.UID_Org join LDAPAccount u on u.UID_Person = pho.UID_Person union select59 u.UID_LDAPAccount as uid from @GroupsChanged g join ESetHasEntitlement ehe on g.Parameter2 = ehe.Entitlement join PersonHasESet phe on phe.UID_ESet =60 ehe.UID_ESet join LDAPAccount u on u.UID_Person = phe.UID_Person ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup', @DBQueueElements_0161 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 62