Back to OIM Explorer

dbo.LDP_TUTSBBehavior

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on TSBBehavior. Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 9; References QBM_PDBQueueInsert_Bulk; Trigger parent table: TSBBehavior

Source: sandbox-db sys.sql_modules

Source size: 1.525 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-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 9
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: TSBBehavior

Typed Edges

  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 9 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 9
  • trigger on table TSBBehavior Trigger parent table: TSBBehavior
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

References

Referenced By

  • No direct source references extracted.

Complete Source

SQL67 lines
1CREATE trigger LDP_TUTSBBehavior2  ON TSBBehavior FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @TSBBehaviorsToCheck 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(PTDInheritGroup) OR21    UPDATE(PFDInheritGroup) OR22    UPDATE(PMDInheritGroup) OR23    UPDATE(PSIInheritGroup) OR24    UPDATE(ADAInheritGroup)25    BEGIN26      INSERT INTO @TSBBehaviorsToCheck(UID_SingleGuid)27      SELECT28        DISTINCT r.uid_TSBBehavior29      FROM TSBBehavior r30      JOIN deleted d31        ON r.uid_TSBBehavior = d.uid_TSBBehavior32      WHERE33        (isnull(r.PTDInheritGroup, 0) <> isnull(d.PTDInheritGroup, 0) OR isnull(r.PFDInheritGroup, 0) <> isnull(d.PFDInheritGroup,34      0) OR isnull(r.PMDInheritGroup, 0) <> isnull(d.PMDInheritGroup, 0) OR isnull(r.PSIInheritGroup, 0) <> isnull(d.PSIInheritGroup,35      0) OR isnull(r.ADAInheritGroup, 0) <> isnull(d.ADAInheritGroup, 0))36      IF 0 <(37        SELECT count(*)38      FROM @TSBBehaviorsToCheck)39      BEGIN40        DECLARE @DBQueueElements_01 QBM_YDBQueueRaw41        INSERT INTO @DBQueueElements_01(object,42        subobject,43        genprocid)44        SELECT45          x.uid,46          NULL,47          @GenProcID48        FROM(49        SELECT a.UID_LDAPAccount AS uid50        FROM LDAPAccount a51        JOIN @TSBBehaviorsToCheck c52          ON a.UID_TSBBehavior = c.UID_SingleGuid) AS x53        EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup',54          @DBQueueElements_0155      END56    END57  END TRY58  BEGIN CATCH59    EXEC QBM_PSessionErrorAdd DEFAULT60    RAISERROR('',61    18,62    1)63      WITH NOWAIT64  END CATCH65  ende:66  RETURN67END
Open raw exported source
SQL ยท Raw11 lines
1 create   trigger LDP_TUTSBBehavior on TSBBehavior  for Update not for Replication as begin  declare @TSBBehaviorsToCheck QBM_YSingleGUID     BEGIN2 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 varchar(383) select @GenProcID = dbo.QBM_FGISessionContext('')  if update(PTDInheritGroup) or update(PFDInheritGroup) or update(PMDInheritGroup) or update(PSIInheritGroup4) or update(ADAInheritGroup) begin insert into @TSBBehaviorsToCheck (UID_SingleGuid ) select distinct r.uid_TSBBehavior from TSBBehavior r join deleted5 d on r.uid_TSBBehavior = d.uid_TSBBehavior where (isnull(r.PTDInheritGroup,0) <> isnull(d.PTDInheritGroup,0) or isnull(r.PFDInheritGroup,0) <> isnull(d.PFDInheritGroup6,0) or isnull(r.PMDInheritGroup,0) <> isnull(d.PMDInheritGroup,0) or isnull(r.PSIInheritGroup,0) <> isnull(d.PSIInheritGroup,0) or isnull(r.ADAInheritGroup7,0) <> isnull(d.ADAInheritGroup,0) ) if 0 < (select count(*) from @TSBBehaviorsToCheck) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_018 (object, subobject, genprocid) select x.uid, null, @GenProcID from (  select a.UID_LDAPAccount as uid from LDAPAccount a join @TSBBehaviorsToCheck c on9 a.UID_TSBBehavior = c.UID_SingleGuid  ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup', @DBQueueElements_01 end end    END TRY BEGIN10 CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 11