dbo.TSB_TIPersonHasTSBAccountDef
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-PersonHasTSBAccountDef / TSB_ZPersonHasTSBAccountDef at line 8
- Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 8
- Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 10
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: PersonHasTSBAccountDef
Typed Edges
- queues DBQueue task TSB_ZPersonHasTSBAccountDef at line 8 Bulk DBQueue insert -> TSB-K-PersonHasTSBAccountDef / TSB_ZPersonHasTSBAccountDef at line 8
- queues DBQueue task TSB_ZPersonHasObject at line 8 Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 8
- queues DBQueue task TSB_ZPersonHasObject at line 10 Bulk DBQueue insert -> TSB-K-PersonHasObject / TSB_ZPersonHasObject at line 10
- trigger on table PersonHasTSBAccountDef Trigger parent table: PersonHasTSBAccountDef
- references source dbo.QBM_FGIBitPatternXOrigin source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QER_FGIITShopFlagCombineValid source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FGIBitPatternXOrigin
- dbo.QBM_FGISessionContext
- dbo.QER_FGIITShopFlagCombineValid
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger TSB_TIPersonHasTSBAccountDef2 ON PersonHasTSBAccountDef FOR3INSERT NOT FOR Replication4AS5BEGIN6 DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',7 0)8 DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',9 1)10 BEGIN TRY11 IF EXISTS(12 SELECT TOP 1 113 FROM inserted)14 GOTO start15 RETURN start:16 DECLARE @GenProcID varchar(38)17 SELECT @GenProcID = dbo.QBM_FGISessionContext('')18 IF EXISTS(19 SELECT TOP 1 120 FROM inserted i21 JOIN TSBAccountDef elem22 ON i.uid_TSBAccountDef = elem.uid_TSBAccountDef23 WHERE24 dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct25 > 0)26 BEGIN27 RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',28 18,29 2)30 WITH nowait31 END32 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw33 INSERT INTO @DBQueueElements_01(object,34 subobject,35 genprocid)36 SELECT37 x.uid,38 NULL,39 @GenProcID40 FROM(41 SELECT42 DISTINCT i.uid_person AS uid43 FROM inserted i44 WHERE45 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x46 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasTSBAccountDef',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 SELECT58 DISTINCT i.uid_person AS uid59 FROM inserted i60 WHERE61 i.XIsInEffect = 1) AS x62 EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject',63 @DBQueueElements_0264 END TRY65 BEGIN CATCH66 EXEC QBM_PSessionErrorAdd DEFAULT67 RAISERROR('',68 18,69 1)70 WITH NOWAIT71 END CATCH72 ende:73 RETURN74END
Open raw exported source
1 create trigger TSB_TIPersonHasTSBAccountDef on PersonHasTSBAccountDef for Insert not for Replication as begin declare @QBM_BitPatternXOrigin_Direct2 int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1) BEGIN3 TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')4 if exists (select top 1 1 from inserted i join TSBAccountDef elem on i.uid_TSBAccountDef = elem.uid_TSBAccountDef where dbo.QER_FGIITShopFlagCombineValid5(i.XObjectKey, null, null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 ) begin raiserror6 ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|', 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert7 into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.uid_person as uid from inserted i where8 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasTSBAccountDef', @DBQueueElements_01 declare @DBQueueElements_029 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.uid_person as uid10 from inserted i where i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd11 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 12