dbo.TSB_TDUNSGroupB3Collection
Database TriggerSQL_TRIGGERSandbox DB
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 8
- Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 8
- Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 11
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: UNSGroupB3Collection
Typed Edges
- queues DBQueue task TSB_ZPersonHasObject at line 8 Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 8
- queues DBQueue task TSB_ZBaseTreeHasObject at line 8 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 8
- queues DBQueue task TSB_ZBaseTreeHasObject at line 11 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 11
- trigger on table UNSGroupB3Collection Trigger parent table: UNSGroupB3Collection
- 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 source dbo.TSB_TDUNSGroupB source text reference
- references source dbo.TSB_TDUNSGroupB3 source text reference
References
- dbo.QBM_FGISessionContext
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.TSB_TDUNSGroupB
- dbo.TSB_TDUNSGroupB3
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger TSB_TDUNSGroupB3Collection2 ON UNSGroupB3Collection FOR3DELETE NOT FOR Replication4AS5BEGIN6 IF EXISTS(7 SELECT TOP 1 18 FROM deleted)9 GOTO start10 RETURN start:11 BEGIN TRY12 DECLARE @GenProcID varchar(38)13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw15 INSERT INTO @DBQueueElements_01(object,16 subobject,17 genprocid)18 SELECT19 x.uid,20 NULL,21 @GenProcID22 FROM(23 SELECT24 DISTINCT a.uid_person AS uid25 FROM UNSAccountBInUNSGroupB3 uig26 JOIN(27 SELECT uid_UNSGroupB3Parent AS UID_Group28 FROM deleted29 UNION30 SELECT UID_UNSGroupB3Child31 FROM deleted) AS x32 ON x.uid_group = uig.uid_UNSGroupB3 AND uig.XOrigin > 033 JOIN UNSAccountB a34 ON uig.UID_UNSAccountB = a.uid_UNSAccountB35 WHERE36 a.uid_person > ' '37 UNION38 SELECT a.uid_person AS uid39 FROM UNSAccountBHasUNSGroupB3 uig40 JOIN(41 SELECT uid_UNSGroupB3Parent AS UID_Group42 FROM deleted43 UNION44 SELECT UID_UNSGroupB3Child45 FROM deleted) AS x46 ON x.uid_group = uig.uid_UNSGroupB3 AND uig.XOrigin > 047 JOIN UNSAccountB a48 ON uig.UID_UNSAccountB = a.uid_UNSAccountB49 WHERE50 a.uid_person > ' ') AS x51 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject',52 @DBQueueElements_0153 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw54 INSERT INTO @DBQueueElements_02(object,55 subobject,56 genprocid)57 SELECT58 x.uid,59 NULL,60 @GenProcID61 FROM(62 SELECT63 DISTINCT uig.UID_Org AS uid64 FROM BaseTreeHasUNSGroupB3 uig65 JOIN(66 SELECT uid_UNSGroupB3Parent AS UID_Group67 FROM deleted68 UNION69 SELECT UID_UNSGroupB3Child70 FROM deleted) AS x71 ON x.uid_group = uig.uid_UNSGroupB3 AND uig.XOrigin > 0) AS x72 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-BaseTreeHasObject',73 @DBQueueElements_0274 END TRY75 BEGIN CATCH76 EXEC QBM_PSessionErrorAdd DEFAULT77 RAISERROR('',78 18,79 1)80 WITH NOWAIT81 END CATCH82 ende:83 RETURN84END
Open raw exported source
1create trigger TSB_TDUNSGroupB3Collection on UNSGroupB3Collection for Delete not for Replication as begin if exists (select top 1 1 from2 deleted) goto start return start: BEGIN TRY declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare @DBQueueElements_013 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct a.uid_person as uid4 from UNSAccountBInUNSGroupB3 uig join (select uid_UNSGroupB3Parent as UID_Group from deleted union select UID_UNSGroupB3Child from deleted ) as 5x on x.uid_group = uig.uid_UNSGroupB3 and uig.XOrigin > 0 join UNSAccountB a on uig.UID_UNSAccountB = a.uid_UNSAccountB where a.uid_person > ' ' union6 select a.uid_person as uid from UNSAccountBHasUNSGroupB3 uig join (select uid_UNSGroupB3Parent as UID_Group from deleted union select UID_UNSGroupB3Child7 from deleted ) as x on x.uid_group = uig.uid_UNSGroupB3 and uig.XOrigin > 0 join UNSAccountB a on uig.UID_UNSAccountB = a.uid_UNSAccountB where a.uid_person8 > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_029 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct uig.UID_Org as uid from BaseTreeHasUNSGroupB3 uig join (select 10uid_UNSGroupB3Parent as UID_Group from deleted union select UID_UNSGroupB3Child from deleted ) as x on x.uid_group = uig.uid_UNSGroupB3 and uig.XOrigin11 > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-BaseTreeHasObject', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR12 ('', 18, 1) WITH NOWAIT END CATCH ende: return end 13