Back to OIM Explorer

dbo.RMS_TUPersonHasESet

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on PersonHasESet. Bulk DBQueue insert -> RMS-K-PersonHasESet / RMS_ZPersonHasESet at line 6; Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 6; Bulk DBQueue insert -> at line 6; Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 10

Source: sandbox-db sys.sql_modules

Source size: 3.068 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 -> RMS-K-PersonHasESet / RMS_ZPersonHasESet at line 6
  • Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 6
  • Bulk DBQueue insert -> at line 6
  • Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 10
  • Bulk DBQueue insert -> at line 10
  • Bulk DBQueue insert -> at line 19
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: PersonHasESet

Typed Edges

  • queues DBQueue task RMS_ZPersonHasESet at line 6 Bulk DBQueue insert -> RMS-K-PersonHasESet / RMS_ZPersonHasESet at line 6
  • queues DBQueue task RMS_ZPersonHasObject at line 6 Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 6
  • queues DBQueue task at line 6 Bulk DBQueue insert -> at line 6
  • queues DBQueue task RMS_ZPersonHasObject at line 10 Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 10
  • queues DBQueue task at line 10 Bulk DBQueue insert -> at line 10
  • queues DBQueue task at line 19 Bulk DBQueue insert -> at line 19
  • trigger on table PersonHasESet Trigger parent table: PersonHasESet
  • 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

Complete Source

SQL137 lines
1CREATE trigger RMS_TUPersonHasESet2  ON PersonHasESet FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @EsetOperation varchar(38)7  DECLARE @EsetTable varchar(30)8  DECLARE @ElementBuffer QBM_YCursorBuffer9  DECLARE @ElementCount int10  DECLARE @ElementIndex int11  DECLARE @DBQueueElements_spezial QBM_YDBQueueRaw12  BEGIN TRY13    IF EXISTS(14      SELECT TOP 1 115      FROM inserted)16    GOTO start17    IF EXISTS(18      SELECT TOP 1 119      FROM deleted)20    GOTO start21    RETURN start:22    DECLARE @GenProcID varchar(38)23    SELECT @GenProcID = dbo.QBM_FGISessionContext('')24    IF25    UPDATE(XOrigin)26    BEGIN27      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw28      INSERT INTO @DBQueueElements_01(object,29      subobject,30      genprocid)31      SELECT32        x.uid,33        NULL,34        @GenProcID35      FROM(36      SELECT37        DISTINCT d.UID_Person AS uid38      FROM deleted d39      JOIN PersonHasESet dd40        ON d.XObjectKey = dd.XObjectKey41      WHERE42        dbo.QBM_FGIXOriginChanged_Except2(d.XOrigin, dd.XOrigin) = 1) AS x43      EXEC QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasESet',44        @DBQueueElements_0145    END46    IF47    UPDATE(XIsInEffect) OR48    UPDATE(XOrigin)49    BEGIN50      DECLARE @DBQueueElements_02 QBM_YDBQueueRaw51      INSERT INTO @DBQueueElements_02(object,52      subobject,53      genprocid)54      SELECT55        x.uid,56        NULL,57        @GenProcID58      FROM(59      SELECT60        DISTINCT a.UID_Person AS uid61      FROM PersonHasESet a62      JOIN deleted d63        ON a.XObjectKey = d.XObjectKey64      WHERE65        (dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 OR dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <>66      dbo.QER_FCVXOriginToInheritInfo(a.XOrigin))) AS x67      EXEC QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasObject',68        @DBQueueElements_0269    END70    IF71    UPDATE(XIsInEffect) OR72    UPDATE(XOrigin)73    BEGIN74      INSERT INTO @ElementBuffer(UID1,75      Ident1)76      SELECT77        DISTINCT v.UID_TaskPerson,78        t.TableName79      FROM deleted i80      JOIN PersonHasESet dd81        ON i.XObjectKey = dd.XObjectKey AND dbo.QBM_FGIXOriginChanged_Effect(i.XOrigin,82      dd.XOrigin,83      i.XIsInEffect,84      dd.XIsInEffect) = 185      JOIN ESetHasEntitlement ehe86        ON i.uid_ESet = ehe.uid_ESet AND ehe.XOrigin > 087      JOIN DialogTable t88        ON ehe.Entitlement LIKE '<Key><T>' + t.TableName + '</T>%' AND t.TableName <> 'ESet'89      JOIN BaseTreeAssign v90        ON t.UID_DialogTable = v.UID_DialogTableElement91      WHERE92        v.UID_TaskPerson > ' '93      SELECT @ElementCount = @@rowcount94      SELECT @ElementIndex = 195      WHILE @ElementIndex <= @ElementCount96      BEGIN97        SELECT98          TOP 1 @EsetOperation = bu.UID1,99          @EsetTable = bu.Ident1100        FROM @ElementBuffer bu101        WHERE102          bu.ElementIndex = @ElementIndex103        DELETE @DBQueueElements_spezial104        INSERT INTO @DBQueueElements_spezial(object,105        subobject,106        genprocid)107        SELECT108          x.uid,109          NULL,110          @GenProcID111        FROM(112        SELECT113          DISTINCT i.uid_person AS uid114        FROM deleted i115        JOIN PersonHasESet dd116          ON i.XObjectKey = dd.XObjectKey AND dbo.QBM_FGIXOriginChanged_Effect(i.XOrigin, dd.XOrigin, i.XIsInEffect,117        dd.XIsInEffect) = 1118        JOIN ESetHasEntitlement ehe119          ON i.uid_ESet = ehe.uid_ESet AND ehe.XOrigin > 0120        WHERE121          ehe.Entitlement LIKE '<Key><T>' + @EsetTable + '</T>%') AS x122        EXEC QBM_PDBQueueInsert_Bulk @EsetOperation,123          @DBQueueElements_spezial124        SELECT @ElementIndex += 1125      END126    END127  END TRY128  BEGIN CATCH129    EXEC QBM_PSessionErrorAdd DEFAULT130    RAISERROR('',131    18,132    1)133      WITH NOWAIT134  END CATCH135  ende:136  RETURN137END
Open raw exported source
SQL ยท Raw21 lines
1create   trigger RMS_TUPersonHasESet on PersonHasESet  for Update not for Replication as begin  declare @EsetOperation varchar(38) declare @EsetTable2 varchar(30) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @DBQueueElements_spezial QBM_YDBQueueRaw3 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 varchar4(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(XOrigin) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_015 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct d.UID_Person as uid from deleted d join PersonHasESet dd on d.XObjectKey6 = dd.XObjectKey where dbo.QBM_FGIXOriginChanged_Except2(d.XOrigin, dd.XOrigin) = 1  ) as x exec QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasESet', @DBQueueElements_017 end  if update(XIsInEffect) or update(XOrigin) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid8) select x.uid, null, @GenProcID from ( select distinct a.UID_Person as uid from PersonHasESet a join deleted d on a.XObjectKey = d.XObjectKey where ( 9dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo10(a.XOrigin) ) ) as x exec QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasObject', @DBQueueElements_02 end if update(XIsInEffect) or update(XOrigin) begin  insert11 into @ElementBuffer(UID1, Ident1) select distinct v.UID_TaskPerson, t.TableName from deleted i join PersonHasESet dd on i.XObjectKey = dd.XObjectKey and12 dbo.QBM_FGIXOriginChanged_Effect(i.XOrigin, dd.XOrigin, i.XIsInEffect, dd.XIsInEffect) = 1 join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet and13 ehe.XOrigin > 0  join DialogTable t on  ehe.Entitlement like '<Key><T>' + t.TableName + '</T>%' and t.TableName <> 'ESet' join BaseTreeAssign v on t.UID_DialogTable14 = v.UID_DialogTableElement where v.UID_TaskPerson > ' ' select @ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex <= @ElementCount15 begin select top 1 @EsetOperation = bu.UID1 , @EsetTable = bu.Ident1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex   delete  @DBQueueElements_spezial16 insert into @DBQueueElements_spezial (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.uid_person as uid from deleted17 i join PersonHasESet dd on i.XObjectKey = dd.XObjectKey and dbo.QBM_FGIXOriginChanged_Effect(i.XOrigin, dd.XOrigin, i.XIsInEffect, dd.XIsInEffect) = 118 join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet and ehe.XOrigin > 0  where  ehe.Entitlement like '<Key><T>' + @EsetTable + '</T>%' ) as x exec19 QBM_PDBQueueInsert_Bulk @EsetOperation, @DBQueueElements_spezial select @ElementIndex += 1 end  end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default20 RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 21