Back to OIM Explorer

dbo.TSB_TIUNSGroupB

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on UNSGroupB. Bulk DBQueue insert -> TSB-K-UNSGroupBInUNSGroupB / TSB_ZUNSGroupBInUNSGroupB at line 5; References QBM_PDBQueueInsert_Bulk; Trigger parent table: UNSGroupB

Source: sandbox-db sys.sql_modules

Source size: 882 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 -> TSB-K-UNSGroupBInUNSGroupB / TSB_ZUNSGroupBInUNSGroupB at line 5
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: UNSGroupB

Typed Edges

  • queues DBQueue task TSB_ZUNSGroupBInUNSGroupB at line 5 Bulk DBQueue insert -> TSB-K-UNSGroupBInUNSGroupB / TSB_ZUNSGroupBInUNSGroupB at line 5
  • trigger on table UNSGroupB Trigger parent table: UNSGroupB
  • 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

Complete Source

SQL50 lines
1CREATE trigger TSB_TIUNSGroupB2  ON UNSGroupB FOR3INSERT NOT FOR Replication4AS5BEGIN6  BEGIN TRY7    IF EXISTS(8      SELECT TOP 1 19      FROM inserted)10    GOTO start11    RETURN start:12    DECLARE @GenProcID varchar(38)13    SELECT @GenProcID = dbo.QBM_FGISessionContext('')14    IF EXISTS(15      SELECT TOP 1 116      FROM inserted i17      JOIN UNSRootB r18        ON i.UID_UNSRootB = r.UID_UNSRootB19      WHERE20        r.GroupUsageMask & 0x01 = 0)21    BEGIN22      RAISERROR('#LDS#Insert ist not allowed because of Root.GroupUsageMask.|',23      18,24      1)25        WITH nowait26    END27    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw28    INSERT INTO @DBQueueElements_01(object,29    subobject,30    genprocid)31    SELECT32      x.uid,33      NULL,34      @GenProcID35    FROM(36    SELECT uid_UNSGroupB AS uid37    FROM inserted) AS x38    EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-UNSGroupBInUNSGroupB',39      @DBQueueElements_0140  END TRY41  BEGIN CATCH42    EXEC QBM_PSessionErrorAdd DEFAULT43    RAISERROR('',44    18,45    1)46      WITH NOWAIT47  END CATCH48  ende:49  RETURN50END
Open raw exported source
SQL ยท Raw7 lines
1    create   trigger TSB_TIUNSGroupB on UNSGroupB  for insert not for Replication as begin  BEGIN TRY if exists (select top 1 1 from inserted2) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if exists (select top 1 1 from inserted i join3 UNSRootB r on i.UID_UNSRootB = r.UID_UNSRootB where r.GroupUsageMask & 0x01 = 0 ) begin raiserror('#LDS#Insert ist not allowed because of Root.GroupUsageMask.|'4, 18, 1) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null,5 @GenProcID from ( select uid_UNSGroupB as uid from inserted ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-UNSGroupBInUNSGroupB', @DBQueueElements_016  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7