dbo.RPS_TIRPSSubscription
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 -> RPS-K-PersonHasObject / RPS_ZPersonHasObject at line 6
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: RPSSubscription
Typed Edges
- queues DBQueue task RPS_ZPersonHasObject at line 6 Bulk DBQueue insert -> RPS-K-PersonHasObject / RPS_ZPersonHasObject at line 6
- trigger on table RPSSubscription Trigger parent table: RPSSubscription
- 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
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger RPS_TIRPSSubscription2 ON RPSSubscription FOR3INSERT NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM inserted)10 GOTO start11 RETURN start:12 DECLARE @GenProcID varchar(38)13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 IF EXISTS(15 SELECT TOP 1 116 FROM inserted i17 JOIN RPSSubscription s18 ON i.UID_RPSSubscription = s.UID_RPSSubscription19 LEFT20 OUTER21 JOIN PersonHasRPSReport t22 ON t.uid_RPSReport = s.UID_RPSReport AND t.UID_Person = s.UID_Person AND t.XOrigin > 023 WHERE24 t.uid_person IS NULL)25 BEGIN26 RAISERROR('#LDS#Assignment is not permitted due to missing combination of person and report.|',27 18,28 2)29 WITH nowait30 END31 DECLARE @DBQueueElements_PHO QBM_YDBQueueRaw32 INSERT INTO @DBQueueElements_PHO(object,33 subobject,34 genprocid)35 SELECT36 x.uid,37 NULL,38 @GenProcID39 FROM(40 SELECT41 DISTINCT i.UID_Person AS uid42 FROM inserted i) AS x43 EXEC QBM_PDBQueueInsert_Bulk 'RPS-K-PersonHasObject',44 @DBQueueElements_PHO45 END TRY46 BEGIN CATCH47 EXEC QBM_PSessionErrorAdd DEFAULT48 RAISERROR('',49 18,50 1)51 WITH NOWAIT52 END CATCH53 ende:54 RETURN55END
Open raw exported source
1 create trigger RPS_TIRPSSubscription on RPSSubscription for Insert not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted2) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if exists (select top 1 1 from inserted i 3join RPSSubscription s on i.UID_RPSSubscription = s.UID_RPSSubscription left outer join PersonHasRPSReport t on t.uid_RPSReport = s.UID_RPSReport and t.UID_Person4 = s.UID_Person and t.XOrigin > 0 where t.uid_person is null ) begin raiserror ('#LDS#Assignment is not permitted due to missing combination of person and report.|'5, 18, 2) with nowait end declare @DBQueueElements_PHO QBM_YDBQueueRaw insert into @DBQueueElements_PHO (object, subobject, genprocid) select x.uid, null6, @GenProcID from ( select distinct i.UID_Person as uid from inserted i ) as x exec QBM_PDBQueueInsert_Bulk 'RPS-K-PersonHasObject', @DBQueueElements_PHO7 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 8