Back to OIM Explorer

dbo.TSB_TDUNSAccountB

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on UNSAccountB. Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 5; References QBM_PDBQueueInsert_Bulk; Trigger parent table: UNSAccountB

Source: sandbox-db sys.sql_modules

Source size: 947 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-PersonHasObject / TSB_ZPersonHasObject at line 5
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: UNSAccountB

Typed Edges

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

SQL53 lines
1CREATE trigger TSB_TDUNSAccountB2  ON UNSAccountB FOR3DELETE NOT FOR Replication4AS5BEGIN6  IF EXISTS(7    SELECT TOP 1 18    FROM deleted)9  GOTO start10  RETURN start:11  DECLARE @GenProcID varchar(38)12  BEGIN TRY13    SELECT @GenProcID = dbo.QBM_FGISessionContext('')14    IF EXISTS(15      SELECT TOP 1 116      FROM deleted d17      JOIN PersonHasTSBAccountDef pha18        ON d.XObjectKey = pha.XObjectKey19      WHERE20        pha.XOrigin > 0 AND pha.XIsInEffect = 1)21    BEGIN22      RAISERROR('#LDS#Delete Accounts with existing PersonHasTSBAccountDef is not permitted.|',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    SELECT37      DISTINCT uid_person AS uid38    FROM deleted39    WHERE40      uid_person > ' ') AS x41    EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject',42      @DBQueueElements_0143  END TRY44  BEGIN CATCH45    EXEC QBM_PSessionErrorAdd DEFAULT46    RAISERROR('',47    18,48    1)49      WITH NOWAIT50  END CATCH51  ende:52  RETURN53END
Open raw exported source
SQL ยท Raw7 lines
1create   trigger TSB_TDUNSAccountB on UNSAccountB  for DELETE not for Replication as begin  if exists (select top 1 1 from deleted) goto start return2 start: declare @GenProcID varchar(38) BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('')  if exists (select top 1 1 from deleted d join PersonHasTSBAccountDef3 pha on d.XObjectKey = pha.XObjectKey where pha.XOrigin > 0 and pha.XIsInEffect = 1  ) begin raiserror('#LDS#Delete Accounts with existing PersonHasTSBAccountDef is not permitted.|'4, 18, 1) with nowait end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null5, @GenProcID from ( select distinct uid_person as uid from deleted where uid_person > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', 6@DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7