dbo.POL_TDQERPolicy
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 -> POL-K-QERPolicyMakeProc / POL_ZQERPolicyMakeProc at line 5
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: QERPolicy
Typed Edges
- queues DBQueue task POL_ZQERPolicyMakeProc at line 5 Bulk DBQueue insert -> POL-K-QERPolicyMakeProc / POL_ZQERPolicyMakeProc at line 5
- trigger on table QERPolicy Trigger parent table: QERPolicy
- 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 POL_TDQERPolicy2 ON QERPolicy FOR3DELETE NOT FOR Replication4AS5BEGIN6 IF EXISTS(7 SELECT TOP 1 18 FROM deleted)9 GOTO start10 RETURN start:11 BEGIN TRY12 DECLARE @GenProcID varchar(38)13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 DECLARE @whereclause nvarchar(1024)15 IF EXISTS(16 SELECT TOP 1 117 FROM deleted r18 WHERE19 r.IsInactive = 0 AND r.IsWorkingCopy = 0)20 BEGIN21 RAISERROR('#LDS#Enabled policies cannot be deleted.|',22 18,23 3)24 WITH nowait25 END26 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw27 INSERT INTO @DBQueueElements_01(object,28 subobject,29 genprocid)30 SELECT31 x.uid,32 NULL,33 @GenProcID34 FROM(35 SELECT d.uid_QERPolicy AS uid36 FROM deleted d) AS x37 EXEC QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyMakeProc',38 @DBQueueElements_0139 END TRY40 BEGIN CATCH41 EXEC QBM_PSessionErrorAdd DEFAULT42 RAISERROR('',43 18,44 1)45 WITH NOWAIT46 END CATCH47 ende:48 RETURN49END
Open raw exported source
1create trigger POL_TDQERPolicy on QERPolicy for Delete not for Replication as begin if exists (select top 1 1 from deleted) goto start return2 start: BEGIN TRY declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare @whereclause nvarchar(1024) if exists (select3 top 1 1 from deleted r where r.IsInactive = 0 and r.IsWorkingCopy = 0 ) begin raiserror( '#LDS#Enabled policies cannot be deleted.|', 18, 3) with nowait4 end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from (5 select d.uid_QERPolicy as uid from deleted d ) as x exec QBM_PDBQueueInsert_Bulk 'POL-K-QERPolicyMakeProc', @DBQueueElements_01 END TRY BEGIN CATCH exec6 QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7