dbo.TSB_TDUNSGroupBExclusion
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-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 8
- Bulk DBQueue insert -> TSB-K-OrgHasUNSGroupB / TSB_ZOrgHasUNSGroupB at line 8
- Bulk DBQueue insert -> TSB-K-OrgHasUNSGroupB / TSB_ZOrgHasUNSGroupB at line 11
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: UNSGroupBExclusion
Typed Edges
- queues DBQueue task TSB_ZUNSAccountBInUNSGroupB at line 8 Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 8
- queues DBQueue task TSB_ZOrgHasUNSGroupB at line 8 Bulk DBQueue insert -> TSB-K-OrgHasUNSGroupB / TSB_ZOrgHasUNSGroupB at line 8
- queues DBQueue task TSB_ZOrgHasUNSGroupB at line 11 Bulk DBQueue insert -> TSB-K-OrgHasUNSGroupB / TSB_ZOrgHasUNSGroupB at line 11
- trigger on table UNSGroupBExclusion Trigger parent table: UNSGroupBExclusion
- 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
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger TSB_TDUNSGroupBExclusion2 ON UNSGroupBExclusion FOR3DELETE NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM deleted)10 GOTO start11 RETURN start:12 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 SELECT uig.UID_UNSAccountB AS uid24 FROM(25 SELECT UID_UNSGroupBLower AS UID_UNSGroupB26 FROM deleted27 UNION28 SELECT UID_UNSGroupBHigher29 FROM deleted) AS y30 JOIN UNSGroupBCollection coll31 ON y.uid_UNSGroupB = coll.UID_UNSGroupBParent32 JOIN UNSAccountBInUNSGroupB uig33 ON coll.UID_UNSGroupBChild = uig.uid_UNSGroupB34 UNION35 SELECT uig.UID_UNSAccountB AS uid36 FROM(37 SELECT UID_UNSGroupBLower AS UID_UNSGroupB38 FROM deleted39 UNION40 SELECT UID_UNSGroupBHigher41 FROM deleted) AS y42 JOIN UNSGroupBCollection coll43 ON y.uid_UNSGroupB = coll.UID_UNSGroupBParent44 JOIN UNSAccountBHasUNSGroupB uig45 ON coll.UID_UNSGroupBChild = uig.uid_UNSGroupB) AS x46 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBInUNSGroupB',47 @DBQueueElements_0148 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw49 INSERT INTO @DBQueueElements_02(object,50 subobject,51 genprocid)52 SELECT53 x.uid,54 NULL,55 @GenProcID56 FROM(57 SELECT g.UID_Org AS uid58 FROM(59 SELECT UID_UNSGroupBLower AS UID_UNSGroupB60 FROM deleted61 UNION62 SELECT UID_UNSGroupBHigher63 FROM deleted) AS y64 JOIN BaseTreeHasUNSGroupB g65 ON y.UID_UNSGroupB = g.UID_UNSGroupB) AS x66 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-OrgHasUNSGroupB',67 @DBQueueElements_0268 END TRY69 BEGIN CATCH70 EXEC QBM_PSessionErrorAdd DEFAULT71 RAISERROR('',72 18,73 1)74 WITH NOWAIT75 END CATCH76 ende:77 RETURN78END
Open raw exported source
1create trigger TSB_TDUNSGroupBExclusion on UNSGroupBExclusion for Delete not for Replication as begin BEGIN TRY if exists (select top 21 1 from deleted) goto start return start: 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 uig.UID_UNSAccountB as uid4 from ( select UID_UNSGroupBLower as UID_UNSGroupB from deleted union select UID_UNSGroupBHigher from deleted ) as y join UNSGroupBCollection5 coll on y.uid_UNSGroupB = coll.UID_UNSGroupBParent join UNSAccountBInUNSGroupB uig on coll.UID_UNSGroupBChild = uig.uid_UNSGroupB union6 select uig.UID_UNSAccountB as uid from ( select UID_UNSGroupBLower as UID_UNSGroupB from deleted union select UID_UNSGroupBHigher from deleted7 ) as y join UNSGroupBCollection coll on y.uid_UNSGroupB = coll.UID_UNSGroupBParent join UNSAccountBHasUNSGroupB uig on coll.UID_UNSGroupBChild8 = uig.uid_UNSGroupB ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBInUNSGroupB', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw9 insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select g.UID_Org as uid from ( select UID_UNSGroupBLower10 as UID_UNSGroupB from deleted union select UID_UNSGroupBHigher from deleted ) as y join BaseTreeHasUNSGroupB g on y.UID_UNSGroupB = g.UID_UNSGroupB11 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-OrgHasUNSGroupB', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR (12'', 18, 1) WITH NOWAIT END CATCH ende: return end 13