dbo.QER_TDPerson
SQL_TRIGGER parent Person
Created 2025-06-27T18:01:08.223 · modified 2026-04-14T23:23:08.430 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| delegation | OBJECT_OR_COLUMN | ||
| deleted | OBJECT_OR_COLUMN | ||
| PersonWantsOrg | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Single | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YDBQueueRaw | TYPE | ||
| QERUniversalSubstitute | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1create trigger QER_TDPerson on Person for delete not for Replication as begin BEGIN TRY if exists (select top 1 1 from deleted) goto start return 2 start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 3 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select uid_personHead as uid from deleted where uid_personHead > ' ' union select 4 us.UID_PersonReceiver as uid from deleted d join QERUniversalSubstitute us on d.UID_PersonHead = us.UID_PersonSender where d.UID_PersonHead > ' ' and 5us.IsCurrentlyActive = 1 and us.UseForHeadPerson = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-HelperHeadPerson', @DBQueueElements_01 if exists (select 6 top 1 1 from deleted d join delegation dl on d.uid_Person = dl.UID_PersonReceiver or d.UID_person = dl.UID_PersonSender join PersonWantsOrg pwo on dl.UID_PersonWantsOrg 7 = pwo.UID_PersonWantsOrg where pwo.OrderState in ('Assigned', 'Granted', 'New', 'OrderProduct', 'OrderProlongate', 'OrderUnsubscribe', 'Waiting') ) 8 begin raiserror( '#LDS#Cannot delete person, because active delegation(s) are existing.|', 18, 3) with nowait end delete delegation where UID_PersonReceiver 9 in (select uid_person from deleted ) delete delegation where UID_PersonSender in (select uid_person from deleted ) exec QBM_PDBQueueInsert_Single 'QBM-K-CommonReCalculate' 10, 'QER-K-ITShopRepairClosed', '', @GenProcID END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return 11 end 12
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.430
inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PDBQueueInsert_Single, QBM_PSessionErrorAdd; writes INSERT into, DELETE not, DELETE person, DELETE delegation; reads/joins deleted, QERUniversalSubstitute, delegation, PersonWantsOrg
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into DELETE not DELETE person DELETE delegationRead/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
QER-K-HelperHeadPerson QBM-K-CommonReCalculate QER-K-ITShopRepairClosedTemp tables / referenced variables
Temp: #LDS #Cannot
Variables: @GenProcID @DBQueueElements_01
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.