Back to OIM Explorer

dbo.POL_TUATTPersonInBaseTree

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on PersonInBaseTree. Bulk DBQueue insert -> ATT-K-AttestationHelper / ATT_ZAttestationHelperFill at line 11; References QBM_PDBQueueInsert_Bulk; Trigger parent table: PersonInBaseTree

Source: sandbox-db sys.sql_modules

Source size: 1.914 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 -> ATT-K-AttestationHelper / ATT_ZAttestationHelperFill at line 11
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: PersonInBaseTree

Typed Edges

  • queues DBQueue task ATT_ZAttestationHelperFill at line 11 Bulk DBQueue insert -> ATT-K-AttestationHelper / ATT_ZAttestationHelperFill at line 11
  • trigger on table PersonInBaseTree Trigger parent table: PersonInBaseTree
  • 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

SQL83 lines
1CREATE trigger POL_TUATTPersonInBaseTree2  ON PersonInBaseTree FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @XUser nvarchar(64) = object_name(@@procid)7  DECLARE @Xdate datetime = getutcdate()8  BEGIN TRY9    IF EXISTS(10      SELECT TOP 1 111      FROM deleted)12    GOTO start13    IF EXISTS(14      SELECT TOP 1 115      FROM inserted)16    GOTO start17    RETURN start:18    DECLARE @GenProcID varchar(38)19    SELECT @GenProcID = dbo.QBM_FGISessionContext('')20    IF21    UPDATE(XOrigin)22    BEGIN23      IF EXISTS(24        SELECT TOP 1 125        FROM deleted d26        JOIN PersonInBaseTree pio27          ON d.XObjectKey = pio.XObjectKey28        JOIN BaseTree b29          ON pio.UID_Org = b.UID_Org AND b.UID_OrgRoot = 'QER-V-AERole'30        WHERE31          d.XOrigin > 0 AND pio.XOrigin = 0)32      BEGIN33        DECLARE @DBQueueElements_01 QBM_YDBQueueRaw34        INSERT INTO @DBQueueElements_01(object,35        subobject,36        genprocid)37        SELECT38          x.uid,39          NULL,40          @GenProcID41        FROM(42        SELECT ac.UID_attestationcase AS uid43        FROM deleted d44        JOIN PersonInBaseTree pio45          ON d.XObjectKey = pio.XObjectKey46        JOIN QERPolicy qp47          ON d.UID_Org = qp.UID_AERoleAttestator48        JOIN attestationcase ac49          ON ac.ObjectkeyBase = qp.XObjectKey50        JOIN AttestationHelper ah51          ON ac.uid_attestationCase = ah.uid_attestationcase AND ah.UID_PWODecisionRule IN('POL-PWODecisionRule-AY')52        WHERE53          d.XOrigin > 0 AND pio.XOrigin = 054        UNION55        SELECT ac.UID_attestationcase AS uid56        FROM deleted d57        JOIN PersonInBaseTree pio58          ON d.XObjectKey = pio.XObjectKey59        JOIN QERPolicy qp60          ON d.UID_Org = qp.UID_AERoleAttestator61        JOIN QERPolicyHasObject pho62          ON qp.UID_QERPolicy = pho.UID_QERPolicy63        JOIN attestationcase ac64          ON ac.ObjectkeyBase = pho.XObjectKey65        JOIN AttestationHelper ah66          ON ac.uid_attestationCase = ah.uid_attestationcase AND ah.UID_PWODecisionRule IN('POL-PWODecisionRule-AY')67        WHERE68          d.XOrigin > 0 AND pio.XOrigin = 0) AS x69        EXEC QBM_PDBQueueInsert_Bulk 'ATT-K-AttestationHelper',70          @DBQueueElements_0171      END72    END73  END TRY74  BEGIN CATCH75    EXEC QBM_PSessionErrorAdd DEFAULT76    RAISERROR('',77    18,78    1)79      WITH NOWAIT80  END CATCH81  ende:82  RETURN83END
Open raw exported source
SQL ยท Raw14 lines
1create   trigger POL_TUATTPersonInBaseTree on PersonInBaseTree  for Update not for Replication as begin   declare @XUser nvarchar(64) = object_name2(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY if exists (select top 1 1 from deleted) goto start if exists (select top 1 1 from inserted)3 goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(XOrigin) begin if exists (select top4 1 1 from deleted d join PersonInBaseTree pio on d.XObjectKey = pio.XObjectKey join BaseTree b on pio.UID_Org = b.UID_Org and b.UID_OrgRoot = 'QER-V-AERole'5 where d.XOrigin > 0 and pio.XOrigin = 0 ) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid6) select x.uid, null, @GenProcID from (  select ac.UID_attestationcase as uid from deleted d join PersonInBaseTree pio on d.XObjectKey = pio.XObjectKey7 join QERPolicy qp on d.UID_Org = qp.UID_AERoleAttestator join attestationcase ac on ac.ObjectkeyBase = qp.XObjectKey join AttestationHelper ah on ac.uid_attestationCase8 = ah.uid_attestationcase and ah.UID_PWODecisionRule in ('POL-PWODecisionRule-AY') where d.XOrigin > 0 and pio.XOrigin = 0 union  select ac.UID_attestationcase9 as uid from deleted d join PersonInBaseTree pio on d.XObjectKey = pio.XObjectKey join QERPolicy qp on d.UID_Org = qp.UID_AERoleAttestator join QERPolicyHasObject10 pho on qp.UID_QERPolicy = pho.UID_QERPolicy join attestationcase ac on ac.ObjectkeyBase = pho.XObjectKey join AttestationHelper ah on ac.uid_attestationCase11 = ah.uid_attestationcase and ah.UID_PWODecisionRule in ('POL-PWODecisionRule-AY') where d.XOrigin > 0 and pio.XOrigin = 0 ) as x exec QBM_PDBQueueInsert_Bulk12 'ATT-K-AttestationHelper', @DBQueueElements_01 end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH13 ende: return end 14