dbo.QER_TUPersonHasQERResource
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 5
- Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 5
- Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 9
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: PersonHasQERResource
Typed Edges
- queues DBQueue task QER_ZPersonHasQERResource at line 5 Bulk DBQueue insert -> QER-K-PersonHasQERResource / QER_ZPersonHasQERResource at line 5
- queues DBQueue task QER_ZPersonHasObject at line 5 Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 5
- queues DBQueue task QER_ZPersonHasObject at line 9 Bulk DBQueue insert -> QER-K-PersonHasObject / QER_ZPersonHasObject at line 9
- trigger on table PersonHasQERResource Trigger parent table: PersonHasQERResource
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_FGIXOriginChanged_Effect source text reference
- references source dbo.QBM_FGIXOriginChanged_Except2 source text reference
- references source dbo.QER_FCVXOriginToInheritInfo source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.QER_TUPerson source text reference
References
- dbo.QBM_FGISessionContext
- dbo.QBM_FGIXOriginChanged_Effect
- dbo.QBM_FGIXOriginChanged_Except2
- dbo.QER_FCVXOriginToInheritInfo
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.QER_TUPerson
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger QER_TUPersonHasQERResource2 ON PersonHasQERResource FOR3UPDATE NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM inserted)10 GOTO start11 IF EXISTS(12 SELECT TOP 1 113 FROM deleted)14 GOTO start15 RETURN start:16 DECLARE @GenProcID varchar(38)17 SELECT @GenProcID = dbo.QBM_FGISessionContext('')18 IF19 UPDATE(XOrigin)20 BEGIN21 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw22 INSERT INTO @DBQueueElements_01(object,23 subobject,24 genprocid)25 SELECT26 x.uid,27 NULL,28 @GenProcID29 FROM(30 SELECT31 DISTINCT d.UID_Person AS uid32 FROM deleted d33 JOIN PersonHasQERResource dd34 ON d.XObjectKey = dd.XObjectKey35 WHERE36 dbo.QBM_FGIXOriginChanged_Except2(d.XOrigin, dd.XOrigin) = 1) AS x37 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERResource',38 @DBQueueElements_0139 END40 IF41 UPDATE(XIsInEffect) OR42 UPDATE(XOrigin)43 BEGIN44 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw45 INSERT INTO @DBQueueElements_02(object,46 subobject,47 genprocid)48 SELECT49 x.uid,50 NULL,51 @GenProcID52 FROM(53 SELECT54 DISTINCT a.UID_Person AS uid55 FROM PersonHasQERResource a56 JOIN deleted d57 ON a.XObjectKey = d.XObjectKey58 WHERE59 dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 OR dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <>60 dbo.QER_FCVXOriginToInheritInfo(a.XOrigin)) AS x61 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasObject',62 @DBQueueElements_0263 END64 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
1create trigger QER_TUPersonHasQERResource on PersonHasQERResource for Update not for Replication as begin BEGIN TRY if exists (select top 1 21 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext3('') if update(XOrigin) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, 4null, @GenProcID from ( select distinct d.UID_Person as uid from deleted d join PersonHasQERResource dd on d.XObjectKey = dd.XObjectKey where dbo.QBM_FGIXOriginChanged_Except25(d.XOrigin, dd.XOrigin) = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasQERResource', @DBQueueElements_01 end if update(XIsInEffect) or update6(XOrigin) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID7 from ( select distinct a.UID_Person as uid from PersonHasQERResource a join deleted d on a.XObjectKey = d.XObjectKey where dbo.QBM_FGIXOriginChanged_Effect8(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin) ) 9as x exec QBM_PDBQueueInsert_Bulk 'QER-K-PersonHasObject', @DBQueueElements_02 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR (''10, 18, 1) WITH NOWAIT END CATCH ende: return end 11