dbo.QER_TIBaseTree

SQL_TRIGGER parent BaseTree

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

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
BaseTreeOBJECT_OR_COLUMN
BaseTreecollectionOBJECT_OR_COLUMN
BaseTreeCollectionFOBJECT_OR_COLUMN
DialogGroupOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
OrgRootOBJECT_OR_COLUMN
PersonInBaseTreeOBJECT_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_TIBaseTree on BaseTree  for Insert not for Replication as begin  BEGIN TRY if exists (select top 1 1 from inserted) goto start
2 return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')  if exists (select top 1 1 from inserted i join DialogGroup
3 g on i.UID_DialogGroup = g.UID_DialogGroup where g.IsRoleBasedOnly = 0 ) begin raiserror( '#LDS#Assigment is only permitted for DialogGroup.IsRoleBasedOnly true.|'
4, 18, 2) with nowait end                    declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) 
5select x.uid, null, @GenProcID from ( select i.uid_org as uid from inserted i ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgTreeLEVEL', @DBQueueElements_01
6   declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select
7 i.uid_org as uid from inserted i ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgInherite', @DBQueueElements_02  insert into BaseTreeCollectionF (UID_Org
8, UID_ParentOrg) select x.UID_Org, x.UID_ParentOrg from ( select i.UID_Org, i.UID_Org as UID_ParentOrg from inserted i union select i.UID_Org, e.UID_ParentOrg
9 from inserted i join BaseTreeCollectionF e on i.UID_ParentOrg = e.UID_Org ) as x where not exists (select top 1 1 from BaseTreeCollectionF f where f.UID_Org
10 = x.UID_Org and f.UID_ParentOrg = x.UID_ParentOrg )  declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid
11) select x.uid, null, @GenProcID from ( select i.uid_org as uid from inserted i       ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-BaseTreeCollectionF', 
12@DBQueueElements_03  declare @DBQueueElements_05 QBM_YDBQueueRaw insert into @DBQueueElements_05 (object, subobject, genprocid) select x.uid, null, @GenProcID
13 from ( select i.uid_org as uid from inserted i where i.uid_orgroot = 'QER-V-ITShopOrg' and i.itshopinfo in ('SC', 'SH', 'BO', 'PR')  ) as x exec QBM_PDBQueueInsert_Bulk
14 'QER-K-ShoppingRack-All', @DBQueueElements_05  if exists (select top 1 1 from inserted i where i.ITShopInfo > ' ' and i.UID_OrgRoot not in ('QER-V-ITShopOrg'
15, 'QER-V-ITShopSrc') ) begin  raiserror('#LDS#Cannot set IT Shop information, because role class is not suitable for IT Shop.|', 18, 2) with nowait end
16 if exists (select top 1 1 from inserted i left outer join BaseTree p on i.UID_ParentOrg = p.UID_Org and i.UID_OrgRoot = p.UID_OrgRoot where i.UID_ParentOrg
17 > ' ' and p.UID_Org is null ) begin raiserror( '#LDS#Cannot insert node, because predecessor does not exist in the same role class.|', 18, 2) with nowait
18 end  insert into BaseTreecollection (uid_org, uid_parentorg) select x.uid_org, x.uid_parentorg from ( select i.UID_Org as UID_Org, i.UID_Org as UID_ParentOrg
19 from inserted i join OrgRoot r on i.UID_OrgRoot = r.UID_OrgRoot union select i.UID_Org, c.UID_ParentOrg from BaseTreeCollection c join inserted i on c.UID_Org
20 = i.UID_ParentOrg join OrgRoot r on i.UID_OrgRoot = r.UID_OrgRoot where i.IsCutNode = 0 and r.IsTopDown = 1 and i.UID_ParentOrg > ' ' ) as x where not
21 exists (select top 1 1 from BaseTreecollection bc where bc.uid_org = x.uid_org and bc.uid_parentorg = x.uid_parentorg ) declare @DBQueueElements_06 QBM_YDBQueueRaw
22 insert into @DBQueueElements_06 (Object, SubObject, GenProcID) select x.uid, null, @GenProcID from ( select i.UID_Org as uid from inserted i   ) as x 
23exec QBM_PDBQueueInsert_Bulk 'QER-K-AllForOneOrg', @DBQueueElements_06 declare @DBQueueElements_07 QBM_YDBQueueRaw insert into @DBQueueElements_07 (object
24, subobject, genprocid) select x.uid, null, @GenProcID from ( select uid_personHead as uid from inserted where uid_personHead > ' ' union select uid_personHeadSecond
25 as uid from Inserted where uid_personHeadSecond > ' '  union select us.UID_PersonReceiver as uid from inserted i join QERUniversalSubstitute us on us.UID_PersonSender
26 in (i.UID_PersonHead, i.UID_PersonHeadSecond) where us.IsCurrentlyActive = 1 and us.UseForHeadOrg = 1  union select pio.UID_Person from inserted i join
27 PersonInBaseTree pio on i.UID_AERoleManager = pio.UID_Org  union select us.UID_PersonReceiver as uid from inserted i join PersonInBaseTree pio on i.UID_AERoleManager
28 = pio.UID_Org join QERUniversalSubstitute us on us.UID_PersonSender = pio.UID_Person where us.IsCurrentlyActive = 1 and us.UseForHeadOrg = 1 ) as x exec
29 QBM_PDBQueueInsert_Bulk 'QER-K-HelperHeadOrg', @DBQueueElements_07 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT
30 END CATCH ende: return end 
31

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.960

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

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT not, INSERT into, INSERT BaseTreeCollectionF, INSERT node, INSERT BaseTreecollection; reads/joins inserted, DialogGroup, BaseTreeCollectionF, BaseTree, OrgRoot…

Declared parameters

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

DML targets

INSERT not INSERT into INSERT BaseTreeCollectionF INSERT node INSERT BaseTreecollection

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

QER-K-OrgTreeLEVEL QER-K-OrgInherite QER-K-BaseTreeCollectionF QER-K-AllForOneOrg QER-K-HelperHeadOrg

Temp tables / referenced variables

Temp: #LDS #Assigment #Cannot

Variables: @GenProcID @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_03 @DBQueueElements_05 @DBQueueElements_06 @DBQueueElements_07

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.