dbo.RMB_TUWorkDesk
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 -> RMB-K-HelperWorkdeskOrg / RMB_ZHelperWorkdeskOrg at line 6
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: WorkDesk
Typed Edges
- queues DBQueue task RMB_ZHelperWorkdeskOrg at line 6 Bulk DBQueue insert -> RMB-K-HelperWorkdeskOrg / RMB_ZHelperWorkdeskOrg at line 6
- trigger on table WorkDesk Trigger parent table: WorkDesk
- 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 RMB_TUWorkDesk2 ON WorkDesk 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(uid_org)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 w.uid_WorkDesk AS uid32 FROM deleted d33 JOIN WorkDesk w34 ON d.uid_WorkDesk = w.uid_WorkDesk35 WHERE36 isnull(d.uid_department, '') <> isnull(w.uid_department, '') OR isnull(d.uid_locality, '') <> isnull(w.uid_locality,37 '') OR isnull(d.uid_ProfitCenter, '') <> isnull(w.uid_ProfitCenter, '') OR isnull(d.uid_org, '') <> isnull(w.uid_org,38 '') OR isnull(d.IsNoInherite, 0) <> isnull(w.IsNoInherite, 0)) AS x39 EXEC QBM_PDBQueueInsert_Bulk 'RMB-K-HelperWorkdeskOrg',40 @DBQueueElements_0141 END42 END TRY43 BEGIN CATCH44 EXEC QBM_PSessionErrorAdd DEFAULT45 RAISERROR('',46 18,47 1)48 WITH NOWAIT49 END CATCH50 RETURN51END
Open raw exported source
1 create trigger RMB_TUWorkDesk on WorkDesk for Update not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted) goto2 start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext(''3) if update(uid_org) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null4, @GenProcID from ( select distinct w.uid_WorkDesk as uid from deleted d join WorkDesk w on d.uid_WorkDesk = w.uid_WorkDesk where isnull(d.uid_department5,'') <> isnull(w.uid_department,'') or isnull(d.uid_locality,'') <> isnull(w.uid_locality,'') or isnull(d.uid_ProfitCenter,'') <> isnull(w.uid_ProfitCenter6,'') or isnull(d.uid_org,'') <> isnull(w.uid_org,'') or isnull(d.IsNoInherite,0) <> isnull(w.IsNoInherite,0) ) as x exec QBM_PDBQueueInsert_Bulk 'RMB-K-HelperWorkdeskOrg'7, @DBQueueElements_01 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH return end 8