dbo.QER_TUQERUniversalSubstitute

SQL_TRIGGER parent QERUniversalSubstitute

Created 2025-06-27T18:01:08.657 · modified 2026-04-14T23:23:08.770 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
deletedOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
PersonWantsOrgOBJECT_OR_COLUMN
PWOHelperPWOOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
QERUniversalSubstituteOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1create   trigger QER_TUQERUniversalSubstitute on QERUniversalSubstitute  for Update not for Replication as begin declare @GenProcID varchar(38) 
2= dbo.QBM_FGISessionContext('') BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return
3 start: if update(IsCurrentlyActive) or UPDATE(UseForITShopCompliance) or UPDATE(UseForITShop) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert
4 into @DBQueueElements_01(object, subobject, genprocid) select x.uid, null, @GenProcID from(  select pwo.UID_PersonWantsOrg as uid from deleted d join 
5QERUniversalSubstitute su on d.UID_QERUniversalSubstitute = su.UID_QERUniversalSubstitute join PWOHelperPWO h on su.UID_PersonReceiver = h.UID_PersonHead
6 join PersonWantsOrg pwo on h.UID_PersonWantsOrg = pwo.UID_PersonWantsOrg and h.LevelNumber = pwo.DecisionLevel where( (d.IsCurrentlyActive = 1 and su.IsCurrentlyActive
7 = 0) or (d.UseForITShop = 1 and su.UseForITShop = 0) or (d.UseForITShopCompliance = 1 and su.UseForITShopCompliance = 0) ) and pwo.OrderState in ('OrderProduct'
8, 'OrderProlongate', 'OrderUnsubscribe') union  select pwo.UID_PersonWantsOrg as uid from deleted d join QERUniversalSubstitute su on d.UID_QERUniversalSubstitute
9 = su.UID_QERUniversalSubstitute join PWOHelperPWO h on d.UID_PersonSender = h.UID_PersonHead join PersonWantsOrg pwo on h.UID_PersonWantsOrg = pwo.UID_PersonWantsOrg
10 and h.LevelNumber = pwo.DecisionLevel where( (d.IsCurrentlyActive = 0 and su.IsCurrentlyActive = 1 ) or (d.UseForITShop = 0 and su.UseForITShop = 1) or
11 (d.UseForITShopCompliance = 0 and su.UseForITShopCompliance = 1) ) and pwo.OrderState in ('OrderProduct', 'OrderProlongate', 'OrderUnsubscribe') ) as 
12x exec QBM_PDBQueueInsert_Bulk 'QER-K-ShoppingRackPWOHelperPWO' , @DBQueueElements_01 end  if update(IsCurrentlyActive) or UPDATE(UseForHeadOrg) begin 
13declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02(object, subobject, genprocid) select x.uid, null, @GenProcID from(  select 
14d.UID_PersonReceiver as uid from deleted d join QERUniversalSubstitute su on d.UID_QERUniversalSubstitute = su.UID_QERUniversalSubstitute where( (d.IsCurrentlyActive
15 <> su.IsCurrentlyActive ) and (d.UseForHeadOrg = 1 or su.UseForHeadOrg = 1) ) or ( (d.UseForHeadOrg <> su.UseForHeadOrg) and (d.IsCurrentlyActive = 1 
16or su.IsCurrentlyActive = 1 ) ) ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-HelperHeadOrg', @DBQueueElements_02 end if update(IsCurrentlyActive) or UPDATE
17(UseForHeadPerson) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03(object, subobject, genprocid) select x.uid, null, 
18@GenProcID from(  select d.UID_PersonReceiver as uid from deleted d join QERUniversalSubstitute su on d.UID_QERUniversalSubstitute = su.UID_QERUniversalSubstitute
19 where( (d.IsCurrentlyActive <> su.IsCurrentlyActive ) and (d.UseForHeadPerson = 1 or su.UseForHeadPerson = 1) ) or ((d.UseForHeadPerson <> su.UseForHeadPerson
20) and (d.IsCurrentlyActive = 1 or su.IsCurrentlyActive = 1 ) ) ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-HelperHeadPerson', @DBQueueElements_03 end END
21 TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 
22

Module relation graph

Loading module relation graph…

Source-derived context

Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.

provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:23:08.770

inserts DBQueue tasks uses session context values has TRY/CATCH error handling

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, UPDATE not; reads/joins inserted, deleted, QERUniversalSubstitute, PWOHelperPWO, PersonWantsOrg

Declared parameters

No declared parameters in sys.parameters for this object, or metadata was not available.

DML targets

INSERT into UPDATE not

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

QER-K-ShoppingRackPWOHelperPWO QER-K-HelperHeadOrg QER-K-HelperHeadPerson

Temp tables / referenced variables

Temp: None extracted.

Variables: @GenProcID @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_03

Referenced by / reverse dependencies

Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.

No reverse dependencies extracted.