dbo.QER_TIPersonHasQERResource
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-PersonHasQERResource / QER_ZPersonHasQERResource 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: PersonHasQERResource
Typed Edges
- queues DBQueue task QER_ZPersonHasQERResource at line 8 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource 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 PersonHasQERResource Trigger parent table: PersonHasQERResource
- 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
References
- dbo.QBM_FGIBitPatternXOrigin
- dbo.QBM_FGISessionContext
- dbo.QER_FGIITShopFlagCombineValid
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.QER_TIPerson
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger QER_TIPersonHasQERResource2 ON PersonHasQERResource 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 DECLARE @neu_uid_person varchar(38)19 DECLARE @operation nvarchar(64)20 DECLARE @zeilen int21 DECLARE @errno int22 DECLARE @errmsg nvarchar(255)23 IF EXISTS(24 SELECT TOP 1 125 FROM inserted i26 JOIN QERResource elem27 ON i.uid_QERResource = elem.uid_QERResource28 WHERE29 dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct30 > 0)31 BEGIN32 RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',33 18,34 2)35 WITH nowait36 END37 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw38 INSERT INTO @DBQueueElements_01(object,39 subobject,40 genprocid)41 SELECT42 x.uid,43 NULL,44 @GenProcID45 FROM(46 SELECT47 DISTINCT i.uid_person AS uid48 FROM inserted i49 WHERE50 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x51 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERResource',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 i.uid_person AS uid64 FROM inserted i65 WHERE66 i.XIsInEffect = 1) AS x67 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasObject',68 @DBQueueElements_0269 END TRY70 BEGIN CATCH71 EXEC QBM_PSessionErrorAdd DEFAULT72 RAISERROR('',73 18,74 1)75 WITH NOWAIT76 END CATCH77 ende:78 RETURN79END
Open raw exported source
1 create trigger QER_TIPersonHasQERResource on PersonHasQERResource 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 declare @neu_uid_person varchar(38) declare @operation nvarchar(64) declare @zeilen int declare @errno int declare @errmsg nvarchar(255) if exists 5(select top 1 1 from inserted i join QERResource elem on i.uid_QERResource = elem.uid_QERResource where dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey6, null, 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-PersonHasQERResource', @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