Back to OIM Explorer

dbo.ATT_TUQERUniversalSubstitute

Database TriggerSQL_TRIGGERSandbox DB

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

Source: sandbox-db sys.sql_modules

Source size: 1.680 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 10
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: QERUniversalSubstitute

Typed Edges

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

SQL65 lines
1CREATE trigger ATT_TUQERUniversalSubstitute2  ON QERUniversalSubstitute FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')7  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    IF18    UPDATE(IsCurrentlyActive) OR19    UPDATE(UseForAttestation)20    BEGIN21      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw22      INSERT INTO @DBQueueElements_01(object,23      subobject,24      genprocid)25      SELECT26        x.uid,27        NULL,28        @GenProcID29      FROM(30      SELECT ac.UID_AttestationCase AS uid31      FROM deleted d32      JOIN QERUniversalSubstitute su33        ON d.UID_QERUniversalSubstitute = su.UID_QERUniversalSubstitute34      JOIN AttestationHelper h35        ON su.UID_PersonReceiver = h.UID_PersonHead36      JOIN AttestationCase ac37        ON h.UID_AttestationCase = ac.UID_AttestationCase AND h.LevelNumber = ac.DecisionLevel38      WHERE39        ((d.IsCurrentlyActive = 1 AND su.IsCurrentlyActive = 0) OR(d.UseForAttestation = 1 AND su.UseForAttestation = 0)) AND ac.IsClosed = 040      UNION41      SELECT ac.UID_AttestationCase AS uid42      FROM deleted d43      JOIN QERUniversalSubstitute su44        ON d.UID_QERUniversalSubstitute = su.UID_QERUniversalSubstitute45      JOIN AttestationHelper h46        ON d.UID_PersonSender = h.UID_PersonHead47      JOIN AttestationCase ac48        ON h.UID_AttestationCase = ac.UID_AttestationCase AND h.LevelNumber = ac.DecisionLevel49      WHERE50        ((d.IsCurrentlyActive = 0 AND su.IsCurrentlyActive = 1) OR(d.UseForAttestation = 0 AND su.UseForAttestation = 1)) AND ac.IsClosed = 0) AS51      x52      EXEC QBM_PDBQueueInsert_Bulk 'ATT-K-AttestationHelper',53        @DBQueueElements_0154    END55  END TRY56  BEGIN CATCH57    EXEC QBM_PSessionErrorAdd DEFAULT58    RAISERROR('',59    18,60    1)61      WITH NOWAIT62  END CATCH63  ende:64  RETURN65END
Open raw exported source
SQL ยท Raw12 lines
1create   trigger ATT_TUQERUniversalSubstitute on QERUniversalSubstitute  for Update not for Replication as begin declare @GenProcID varchar(38) 2= dbo.QBM_FGISessionContext('') BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return3 start: if update(IsCurrentlyActive) or UPDATE(UseForAttestation) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01(object4, subobject, genprocid) select x.uid, null, @GenProcID from(  select ac.UID_AttestationCase as uid from deleted d join QERUniversalSubstitute su on d.UID_QERUniversalSubstitute5 = su.UID_QERUniversalSubstitute join AttestationHelper h on su.UID_PersonReceiver = h.UID_PersonHead join AttestationCase ac on h.UID_AttestationCase 6= ac.UID_AttestationCase and h.LevelNumber = ac.DecisionLevel where( (d.IsCurrentlyActive = 1 and su.IsCurrentlyActive = 0) or (d.UseForAttestation = 17 and su.UseForAttestation = 0) ) and ac.IsClosed = 0 union  select ac.UID_AttestationCase as uid from deleted d join QERUniversalSubstitute su on d.UID_QERUniversalSubstitute8 = su.UID_QERUniversalSubstitute join AttestationHelper h on d.UID_PersonSender = h.UID_PersonHead join AttestationCase ac on h.UID_AttestationCase = ac.UID_AttestationCase9 and h.LevelNumber = ac.DecisionLevel where( (d.IsCurrentlyActive = 0 and su.IsCurrentlyActive = 1 ) or (d.UseForAttestation = 0 and su.UseForAttestation10 = 1) ) and ac.IsClosed = 0 ) as x exec QBM_PDBQueueInsert_Bulk 'ATT-K-AttestationHelper' , @DBQueueElements_01 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd11 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 12