dbo.TSB_TIBaseTreeHasTSBAccountDef

SQL_TRIGGER parent BaseTreeHasTSBAccountDef

Created 2025-06-27T18:01:21.157 · modified 2026-04-14T23:23:07.997 · 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
helperPersonOrgOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
personinBaseTreeOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
QBM_YparameterListTYPE
QER_PAssignmentCheckValidOBJECT_OR_COLUMN
TSBAccountDefOBJECT_OR_COLUMN
dboQBM_FGIBitPatternXOriginOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN
dboQER_FGIITShopFlagCombineValidOBJECT_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

1  create   trigger TSB_TIBaseTreeHasTSBAccountDef on BaseTreeHasTSBAccountDef  for Insert not for Replication as begin  declare @QBM_BitPatternXOrigin_Direct
2 int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1)  BEGIN
3 TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')
4  declare @AssignCheckValues QBM_YparameterList insert into @AssignCheckValues(Parameter1, Parameter2) select i.UID_Org, i.XOrigin from inserted i exec
5 QER_PAssignmentCheckValid 'TSB-AsgnBT-TSBAccountDef', @AssignCheckValues, @GenProcID  if exists (select top 1 1 from inserted i join BaseTree dest on 
6i.uid_Org = dest.uid_Org  join TSBAccountDef elem on i.uid_TSBAccountDef = elem.uid_TSBAccountDef where dbo.QER_FGIITShopFlagCombineValid(dest.XObjectKey
7, null, null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 ) begin  raiserror ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|'
8, 18, 2) with nowait end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, 'TSB-K-OrgHasTSBAccountDef'
9, @GenProcID from ( select distinct d.uid_org as uid from inserted d  where d.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0  ) as x exec QBM_PDBQueueInsert_Bulk
10 'QER-K-AllChildrenOfOrg', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid
11) select x.uid, null, @GenProcID from ( select distinct b.uid_org as uid from inserted d join BaseTree b on d.uid_org = b.uid_org where b.ITShopInfo = 
12'BO' and d.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild', @DBQueueElements_02  declare @DBQueueElements_03 QBM_YDBQueueRaw insert
13 into @DBQueueElements_03 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct uid_org as uid from inserted where XIsInEffect
14 = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-BaseTreeHasObject', @DBQueueElements_03  declare @DBQueueElements_04 QBM_YDBQueueRaw insert into @DBQueueElements_04
15 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct hpo.uid_person as uid from inserted i join (select pio.uid_person
16, pio.uid_org from personinBaseTree pio where pio.XOrigin > 0 union all select uid_person, uid_org from helperPersonOrg ) hpo on hpo.uid_org = i.uid_org
17 where i.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasTSBAccountDef', @DBQueueElements_04 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd
18 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 
19

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

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

Summary: calls QER_PAssignmentCheckValid, QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT not, INSERT into; reads/joins inserted, BaseTree, TSBAccountDef, personinBaseTree, helperPersonOrg

Declared parameters

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

DML targets

INSERT not INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

TSB-K-OrgHasTSBAccountDef QER-K-AllChildrenOfOrg QER-K-OrgAutoChild TSB-K-BaseTreeHasObject TSB-K-PersonHasTSBAccountDef

Temp tables / referenced variables

Temp: #LDS #Assignment

Variables: @QBM_BitPatternXOrigin_Direct @QBM_BitPatternXOrigin_Inherit_inv @GenProcID @AssignCheckValues @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_03 @DBQueueElements_04

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.