dbo.QER_TIPersonHasQERReuse
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 -> QER-K-PersonHasQERReuse / QER_ZPersonHasQERReuse at line 8
- Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 8
- Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 10
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: PersonHasQERReuse
Typed Edges
- queues DBQueue task QER_ZPersonHasQERReuse at line 8 Bulk DBQueue insert -> QER-K-PersonHasQERReuse / QER_ZPersonHasQERReuse at line 8
- queues DBQueue task QER_ZPersonHasObject at line 8 Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 8
- queues DBQueue task QER_ZPersonHasObject at line 10 Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 10
- trigger on table PersonHasQERReuse Trigger parent table: PersonHasQERReuse
- 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 source dbo.QER_TIPerson source text reference
Complete Source
1CREATE trigger QER_TIPersonHasQERReuse2 ON PersonHasQERReuse 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 DECLARE @XUser nvarchar(64)18 SELECT @GenProcID = dbo.QBM_FGISessionContext('')19 DECLARE @neu_uid_person varchar(38)20 DECLARE @operation nvarchar(64)21 DECLARE @zeilen int22 DECLARE @errno int23 DECLARE @errmsg nvarchar(255)24 IF EXISTS(25 SELECT TOP 1 126 FROM inserted i27 JOIN QERReuse elem28 ON i.uid_QERReuse = elem.uid_QERReuse29 WHERE30 dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct31 > 0)32 BEGIN33 RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',34 18,35 2)36 WITH nowait37 END38 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw39 INSERT INTO @DBQueueElements_01(object,40 subobject,41 genprocid)42 SELECT43 x.uid,44 NULL,45 @GenProcID46 FROM(47 SELECT48 DISTINCT i.uid_person AS uid49 FROM inserted i50 WHERE51 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x52 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERReuse',53 @DBQueueElements_0154 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw55 INSERT INTO @DBQueueElements_02(object,56 subobject,57 genprocid)58 SELECT59 x.uid,60 NULL,61 @GenProcID62 FROM(63 SELECT64 DISTINCT i.uid_person AS uid65 FROM inserted i66 WHERE67 i.XIsInEffect = 1) AS x68 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasObject',69 @DBQueueElements_0270 END TRY71 BEGIN CATCH72 EXEC QBM_PSessionErrorAdd DEFAULT73 RAISERROR('',74 18,75 1)76 WITH NOWAIT77 END CATCH78 ende:79 RETURN80END
Open raw exported source
1 create trigger QER_TIPersonHasQERReuse on PersonHasQERReuse 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) declare @XUser nvarchar(64) select @GenProcID = dbo.QBM_FGISessionContext4('') declare @neu_uid_person varchar(38) declare @operation nvarchar(64) declare @zeilen int declare @errno int declare @errmsg nvarchar(255) if exists5 (select top 1 1 from inserted i join QERReuse elem on i.uid_QERReuse = elem.uid_QERReuse where dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, null,6 null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 ) begin raiserror ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|'7, 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null,8 @GenProcID from ( select distinct i.uid_person as uid from inserted i where i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk9 'QER-K-PersonHasQERReuse', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid10) select x.uid, null, @GenProcID from ( select distinct i.uid_person as uid from inserted i where i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk11 'QER-K-PersonHasObject', @DBQueueElements_02 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return12 end 13