dbo.QER_TIBaseTreeExcludesBaseTree
SQL_TRIGGER parent BaseTreeExcludesBasetree
Created 2025-06-27T18:01:07.813 · modified 2026-04-14T23:23:07.970 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| BaseTree | OBJECT_OR_COLUMN | ||
| DynamicGroup | OBJECT_OR_COLUMN | ||
| HardwareinBaseTree | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| personinBaseTree | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YDBQueueRaw | TYPE | ||
| WorkDeskinBaseTree | 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.
1 create trigger QER_TIBaseTreeExcludesBaseTree on BaseTreeExcludesBaseTree for Insert not for Replication as begin declare @GenProcID varchar 2(38) = dbo.QBM_FGISessionContext('') BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: if exists (select top 1 1 from inserted 3 i join personinBaseTree pio1 on i.uid_org = pio1.uid_org and pio1.XOrigin > 0 join personinBaseTree pio2 on pio1.uid_person = pio2.uid_person and pio2.uid_org 4 = i.uid_orgExcluded and pio2.XOrigin > 0 join BaseTree b1 on pio1.UID_Org = b1.UID_Org join BaseTree b2 on pio2.UID_Org = b2.UID_Org left outer join 5DynamicGroup d1 on b1.XObjectKey = d1.ObjectKeyBaseTree left outer join DynamicGroup d2 on b2.XObjectKey = d2.ObjectKeyBaseTree where d1.UID_DynamicGroup 6 is null and d2.UID_DynamicGroup is null ) begin raiserror( '#LDS#Cannot make a definition because there are already identity assignments to both roles.|' 7, 18, 3) with nowait end if exists (select top 1 1 from inserted i join WorkDeskinBaseTree pio1 on i.uid_org = pio1.uid_org join WorkDeskinBaseTree pio2 8 on pio1.uid_WorkDesk = pio2.uid_WorkDesk and pio2.uid_org = i.uid_orgExcluded join BaseTree b1 on pio1.UID_Org = b1.UID_Org join BaseTree b2 on pio2.UID_Org 9 = b2.UID_Org left outer join DynamicGroup d1 on b1.XObjectKey = d1.ObjectKeyBaseTree left outer join DynamicGroup d2 on b2.XObjectKey = d2.ObjectKeyBaseTree 10 where d1.UID_DynamicGroup is null and d2.UID_DynamicGroup is null ) begin raiserror( '#LDS#Cannot make a definition because there are already WorkDesk assignments to both roles.|' 11, 18, 3) with nowait end if exists (select top 1 1 from inserted i join HardwareinBaseTree pio1 on i.uid_org = pio1.uid_org and pio1.XOrigin > 0 join HardwareinBaseTree 12 pio2 on pio1.uid_Hardware = pio2.uid_Hardware and pio2.XOrigin > 0 and pio2.uid_org = i.uid_orgExcluded join BaseTree b1 on pio1.UID_Org = b1.UID_Org 13 join BaseTree b2 on pio2.UID_Org = b2.UID_Org left outer join DynamicGroup d1 on b1.XObjectKey = d1.ObjectKeyBaseTree left outer join DynamicGroup d2 14on b2.XObjectKey = d2.ObjectKeyBaseTree where d1.UID_DynamicGroup is null and d2.UID_DynamicGroup is null ) begin raiserror( '#LDS#Cannot make a definition because there are already device assignments to both roles.|' 15, 18, 3) with nowait end if exists (select top 1 1 from inserted i join BaseTree b1 on i.uid_org = b1.UID_Org join BaseTree b2 on i.uid_orgExcluded = b2.UID_Org 16 join DynamicGroup d1 on b1.XObjectKey = d1.ObjectKeyBaseTree join DynamicGroup d2 on b2.XObjectKey = d2.ObjectKeyBaseTree ) begin raiserror( '#LDS#Cannot make a definition because there are already dynamic role assignments to both roles.|' 17, 18, 3) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null 18, @GenProcID from ( select g.UID_DynamicGroup as uid from inserted i join BaseTree b on i.UID_Org = b.UID_Org join DynamicGroup g on b.XObjectKey = g.ObjectKeyBaseTree 19 union select g.UID_DynamicGroup as uid from inserted i join BaseTree b on i.UID_OrgExcluded = b.UID_Org join DynamicGroup g on b.XObjectKey = g.ObjectKeyBaseTree 20 ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-DynamicGroupTest', @DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 21 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:07.970
inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT not, INSERT into; reads/joins inserted, personinBaseTree, BaseTree, DynamicGroup, WorkDeskinBaseTree…
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT not INSERT intoCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
QER-K-DynamicGroupTestTemp 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.