Back to OIM Explorer

dbo.LDP_TUBaseTreeHasLDAPGroup

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on BaseTreeHasLDAPGroup. Bulk DBQueue insert -> LDP-K-BaseTreeHasObject / LDP_ZBaseTreeHasObject at line 6; Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6; Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6; Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 6

Source: sandbox-db sys.sql_modules

Source size: 3.954 characters

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-BaseTreeHasObject / LDP_ZBaseTreeHasObject at line 6
  • Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6
  • Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 6
  • Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 6
  • Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 10
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 10
  • Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 10
  • Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 10
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 12
  • Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 12
  • Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 12
  • Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 16
  • Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 16
  • Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 24
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: BaseTreeHasLDAPGroup

Typed Edges

  • queues DBQueue task LDP_ZBaseTreeHasObject at line 6 Bulk DBQueue insert -> LDP-K-BaseTreeHasObject / LDP_ZBaseTreeHasObject at line 6
  • queues DBQueue task QER_ZAllChildrenOfOrg at line 6 Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 6
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 6 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 6
  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 6 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 6
  • queues DBQueue task LDP_ZLDPMachineInLDAPGroup at line 6 Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 6
  • queues DBQueue task QER_ZAllChildrenOfOrg at line 10 Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 10
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 10 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 10
  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 10 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 10
  • queues DBQueue task LDP_ZLDPMachineInLDAPGroup at line 10 Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 10
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 12 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 12
  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 12 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 12
  • queues DBQueue task LDP_ZLDPMachineInLDAPGroup at line 12 Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 12
  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 16 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 16
  • queues DBQueue task LDP_ZLDPMachineInLDAPGroup at line 16 Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 16
  • queues DBQueue task LDP_ZLDPMachineInLDAPGroup at line 24 Bulk DBQueue insert -> LDP-K-LDPMachineInLDAPGroup / LDP_ZLDPMachineInLDAPGroup at line 24
  • trigger on table BaseTreeHasLDAPGroup Trigger parent table: BaseTreeHasLDAPGroup
  • 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.QER_FCVXOriginToInheritInfo source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL170 lines
1CREATE trigger LDP_TUBaseTreeHasLDAPGroup2  ON BaseTreeHasLDAPGroup FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @ChangedOrg QBM_YSingleGUID7  BEGIN TRY8    IF EXISTS(9      SELECT TOP 1 110      FROM inserted)11    GOTO start12    IF EXISTS(13      SELECT TOP 1 114      FROM deleted)15    GOTO start16    RETURN start:17    DECLARE @GenProcID varchar(38)18    SELECT @GenProcID = dbo.QBM_FGISessionContext('')19    IF20    UPDATE(XOrigin) OR21    UPDATE(XIsInEffect)22    BEGIN23      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw24      INSERT INTO @DBQueueElements_01(object,25      subobject,26      genprocid)27      SELECT28        x.uid,29        NULL,30        @GenProcID31      FROM(32      SELECT33        DISTINCT a.UID_Org AS uid34      FROM BaseTreeHasLDAPGroup a35      JOIN deleted d36        ON a.XObjectKey = d.XObjectKey37      WHERE38        (dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 OR dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <>39      dbo.QER_FCVXOriginToInheritInfo(a.XOrigin))) AS x40      EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-BaseTreeHasObject',41        @DBQueueElements_0142      INSERT INTO @ChangedOrg(UID_SingleGuid)43      SELECT44        DISTINCT d.UID_Org AS uid45      FROM BaseTreeHasLDAPGroup a46      JOIN deleted d47        ON a.XObjectKey = d.XObjectKey48      WHERE49        dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin,50      a.XOrigin,51      d.XIsInEffect,52      a.XIsInEffect) = 153      IF @@ROWCOUNT > 054      BEGIN55        DECLARE @DBQueueElements_02 QBM_YDBQueueRaw56        INSERT INTO @DBQueueElements_02(object,57        subobject,58        genprocid)59        SELECT60          x.uid,61          'LDP-K-OrgHasLDAPGroup',62          @GenProcID63        FROM(64        SELECT c.UID_SingleGuid AS uid65        FROM @ChangedOrg c) AS x66        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg',67          @DBQueueElements_0268        DECLARE @DBQueueElements_03 QBM_YDBQueueRaw69        INSERT INTO @DBQueueElements_03(object,70        subobject,71        genprocid)72        SELECT73          x.uid,74          NULL,75          @GenProcID76        FROM(77        SELECT b.UID_Org AS uid78        FROM @ChangedOrg c79        JOIN BaseTree b80          ON c.UID_SingleGuid = b.UID_Org81        WHERE82          b.ITShopInfo = 'BO') AS x83        EXEC QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild',84          @DBQueueElements_0385        DECLARE @DBQueueElements_04 QBM_YDBQueueRaw86        INSERT INTO @DBQueueElements_04(object,87        subobject,88        genprocid)89        SELECT90          x.uid,91          NULL,92          @GenProcID93        FROM(94        SELECT LDAP.uid_LDAPaccount AS uid95        FROM @ChangedOrg c96        JOIN PersoninBaseTree pio97          ON c.UID_SingleGuid = pio.UID_Org AND pio.XOrigin > 098        JOIN LDAPaccount LDAP99          ON LDAP.uid_person = pio.uid_person AND LDAP.isgroupaccount = 1100        UNION101        SELECT LDAP.uid_LDAPaccount AS uid102        FROM @ChangedOrg c103        JOIN HelperPersonOrg hpo104          ON c.UID_SingleGuid = hpo.UID_Org105        JOIN LDAPaccount LDAP106          ON LDAP.uid_person = hpo.uid_person AND LDAP.isgroupaccount = 1) AS x107        EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup',108          @DBQueueElements_04109        IF '1' = dbo.QBM_FGIConfigparmValue('TargetSystem\LDAP\HardwareInGroupFromOrg')110        BEGIN111          DECLARE @DBQueueElements_05 QBM_YDBQueueRaw112          INSERT INTO @DBQueueElements_05(object,113          subobject,114          genprocid)115          SELECT116            x.uid,117            NULL,118            @GenProcID119          FROM(120          SELECT m.uid_LDPMachine AS uid121          FROM @ChangedOrg c122          JOIN WorkDeskinBaseTree pio123            ON c.UID_SingleGuid = pio.UID_Org AND pio.XOrigin > 0124          JOIN Hardware LDAP125            ON LDAP.uid_WorkDesk = pio.uid_WorkDesk126          JOIN LDPMachine m127            ON LDAP.uid_Hardware = m.UID_Hardware128          UNION129          SELECT m.uid_LDPMachine AS uid130          FROM @ChangedOrg c131          JOIN HelperWorkDeskOrg hpo132            ON c.UID_SingleGuid = hpo.UID_Org133          JOIN Hardware LDAP134            ON LDAP.uid_WorkDesk = hpo.uid_WorkDesk135          JOIN LDPMachine m136            ON LDAP.uid_Hardware = m.UID_Hardware137          UNION138          SELECT m.uid_LDPMachine AS uid139          FROM @ChangedOrg c140          JOIN HardwareinBaseTree pio141            ON c.UID_SingleGuid = pio.UID_Org AND pio.XOrigin > 0142          JOIN Hardware LDAP143            ON LDAP.uid_Hardware = pio.uid_Hardware144          JOIN LDPMachine m145            ON LDAP.UID_Hardware = m.uid_Hardware146          UNION147          SELECT m.uid_LDPMachine AS uid148          FROM @ChangedOrg c149          JOIN HelperHardwareOrg hpo150            ON c.UID_SingleGuid = hpo.UID_Org151          JOIN Hardware LDAP152            ON LDAP.uid_Hardware = hpo.uid_Hardware153          JOIN LDPMachine m154            ON LDAP.UID_Hardware = m.uid_Hardware) AS x155          EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-LDPMachineInLDAPGroup',156            @DBQueueElements_05157        END158      END159    END160  END TRY161  BEGIN CATCH162    EXEC QBM_PSessionErrorAdd DEFAULT163    RAISERROR('',164    18,165    1)166      WITH NOWAIT167  END CATCH168  ende:169  RETURN170END
Open raw exported source
SQL ยท Raw26 lines
1create   trigger LDP_TUBaseTreeHasLDAPGroup on BaseTreeHasLDAPGroup  for Update not for Replication as begin  declare @ChangedOrg QBM_YSingleGUID2 BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar3(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(XOrigin) or update(XIsInEffect) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert4 into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct a.UID_Org as uid from BaseTreeHasLDAPGroup5 a join deleted d on a.XObjectKey = d.XObjectKey where ( dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo6(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin) ) ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-BaseTreeHasObject', @DBQueueElements_01 insert into7 @ChangedOrg (UID_SingleGuid) select distinct d.UID_Org as uid from BaseTreeHasLDAPGroup a join deleted d on a.XObjectKey = d.XObjectKey where dbo.QBM_FGIXOriginChanged_Effect8(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 if @@ROWCOUNT > 0  begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_029 (object, subobject, genprocid) select x.uid, 'LDP-K-OrgHasLDAPGroup', @GenProcID from ( select c.UID_SingleGuid as uid from @ChangedOrg c ) as x exec 10QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg', @DBQueueElements_02 declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object11, subobject, genprocid) select x.uid, null, @GenProcID from ( select b.UID_Org as uid from @ChangedOrg c join BaseTree b on c.UID_SingleGuid = b.UID_Org12 where b.ITShopInfo = 'BO' ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild', @DBQueueElements_03  declare @DBQueueElements_04 QBM_YDBQueueRaw insert13 into @DBQueueElements_04 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select LDAP.uid_LDAPaccount as uid from @ChangedOrg c join14 PersoninBaseTree pio on c.UID_SingleGuid = pio.UID_Org and pio.XOrigin > 0 join LDAPaccount LDAP on LDAP.uid_person = pio.uid_person and LDAP.isgroupaccount15 = 1 union select LDAP.uid_LDAPaccount as uid from @ChangedOrg c join HelperPersonOrg hpo on c.UID_SingleGuid = hpo.UID_Org join LDAPaccount LDAP on LDAP.uid_person16 = hpo.uid_person and LDAP.isgroupaccount = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup', @DBQueueElements_04  if '1' = dbo.QBM_FGIConfigparmValue17('TargetSystem\LDAP\HardwareInGroupFromOrg') begin declare @DBQueueElements_05 QBM_YDBQueueRaw insert into @DBQueueElements_05 (object, subobject, genprocid18) select x.uid, null, @GenProcID from ( select m.uid_LDPMachine as uid from @ChangedOrg c join WorkDeskinBaseTree pio on c.UID_SingleGuid = pio.UID_Org19 and pio.XOrigin > 0 join Hardware LDAP on LDAP.uid_WorkDesk = pio.uid_WorkDesk join LDPMachine m on LDAP.uid_Hardware = m.UID_Hardware union select m.uid_LDPMachine20 as uid from @ChangedOrg c join HelperWorkDeskOrg hpo on c.UID_SingleGuid = hpo.UID_Org join Hardware LDAP on LDAP.uid_WorkDesk = hpo.uid_WorkDesk join21 LDPMachine m on LDAP.uid_Hardware = m.UID_Hardware union select m.uid_LDPMachine as uid from @ChangedOrg c join HardwareinBaseTree pio on c.UID_SingleGuid22 = pio.UID_Org and pio.XOrigin > 0 join Hardware LDAP on LDAP.uid_Hardware = pio.uid_Hardware join LDPMachine m on LDAP.UID_Hardware = m.uid_Hardware union23 select m.uid_LDPMachine as uid from @ChangedOrg c join HelperHardwareOrg hpo on c.UID_SingleGuid = hpo.UID_Org join Hardware LDAP on LDAP.uid_Hardware24 = hpo.uid_Hardware join LDPMachine m on LDAP.UID_Hardware = m.uid_Hardware ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-LDPMachineInLDAPGroup', @DBQueueElements_0525 end  end  end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 26