dbo.QER_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 -> QER-K-HelperWorkdeskOrg / QER_ZHelperWorkdeskOrg at line 6
- Bulk DBQueue insert -> QER-K-AllForOneWorkdesk / QER_ZAllForOneWorkdesk at line 6
- Bulk DBQueue insert -> QER-K-AllForOneWorkdesk / QER_ZAllForOneWorkdesk at line 7
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: WorkDesk
Typed Edges
- queues DBQueue task QER_ZHelperWorkdeskOrg at line 6 Bulk DBQueue insert -> QER-K-HelperWorkdeskOrg / QER_ZHelperWorkdeskOrg at line 6
- queues DBQueue task QER_ZAllForOneWorkdesk at line 6 Bulk DBQueue insert -> QER-K-AllForOneWorkdesk / QER_ZAllForOneWorkdesk at line 6
- queues DBQueue task QER_ZAllForOneWorkdesk at line 7 Bulk DBQueue insert -> QER-K-AllForOneWorkdesk / QER_ZAllForOneWorkdesk at line 7
- 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
Complete Source
1CREATE trigger QER_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_department) OR20 UPDATE(uid_locality) OR21 UPDATE(uid_ProfitCenter) OR22 UPDATE(IsNoInherite)23 BEGIN24 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw25 INSERT INTO @DBQueueElements_02(object,26 subobject,27 genprocid)28 SELECT29 x.uid,30 NULL,31 @GenProcID32 FROM(33 SELECT34 DISTINCT w.uid_WorkDesk AS uid35 FROM deleted d36 JOIN WorkDesk w37 ON d.uid_WorkDesk = w.uid_WorkDesk38 WHERE39 isnull(d.uid_department, '') <> isnull(w.uid_department, '') OR isnull(d.uid_locality, '') <> isnull(w.uid_locality,40 '') OR isnull(d.uid_ProfitCenter, '') <> isnull(w.uid_ProfitCenter, '') OR isnull(d.IsNoInherite, 0) <> isnull(w.IsNoInherite,41 0)) AS x42 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-HelperWorkdeskOrg',43 @DBQueueElements_0244 EXEC QBM_PDBQueueInsert_Bulk 'QER-K-AllForOneWorkdesk',45 @DBQueueElements_0246 END47 END TRY48 BEGIN CATCH49 EXEC QBM_PSessionErrorAdd DEFAULT50 RAISERROR('',51 18,52 1)53 WITH NOWAIT54 END CATCH55 RETURN56END
Open raw exported source
1create trigger QER_TUWorkDesk on WorkDesk for Update not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted) goto start2 if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update3(uid_department) or update(uid_locality) or update(uid_ProfitCenter) or update(IsNoInherite) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into4 @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct w.uid_WorkDesk as uid from deleted d join WorkDesk5 w on d.uid_WorkDesk = w.uid_WorkDesk where isnull(d.uid_department,'') <> isnull(w.uid_department,'') or isnull(d.uid_locality,'') <> isnull(w.uid_locality6,'') or isnull(d.uid_ProfitCenter,'') <> isnull(w.uid_ProfitCenter,'') or isnull(d.IsNoInherite,0) <> isnull(w.IsNoInherite,0) ) as x exec QBM_PDBQueueInsert_Bulk7 'QER-K-HelperWorkdeskOrg', @DBQueueElements_02 exec QBM_PDBQueueInsert_Bulk 'QER-K-AllForOneWorkdesk', @DBQueueElements_02 end END TRY BEGIN CATCH 8exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH return end 9