dbo.TSB_TUTSBAccountDef
SQL_TRIGGER parent TSBAccountDef
Created 2025-06-27T18:01:21.203 · modified 2026-04-14T23:23:08.807 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| AccProduct | OBJECT_OR_COLUMN | ||
| BaseTreeHasTSBAccountDef | OBJECT_OR_COLUMN | ||
| deleted | OBJECT_OR_COLUMN | ||
| dialogColumn | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| PersonHasTSBAccountDef | OBJECT_OR_COLUMN | ||
| PersonWantsOrg | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Bulk | OBJECT_OR_COLUMN | ||
| QBM_PJobCreate_HOUpdate_B | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QBM_YDBQueueRaw | TYPE | ||
| QBM_YParameterlist | TYPE | ||
| QBM_YSingleGUID | TYPE | ||
| QER_PIsForITShopFlagCheck | OBJECT_OR_COLUMN | ||
| QER_PITShopHelperFill_Recalc | OBJECT_OR_COLUMN | ||
| QERAccProductUsage | OBJECT_OR_COLUMN | ||
| TSBAccountDef | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVBigIntToString | 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 TSB_TUTSBAccountDef on TSBAccountDef for Update not for Replication as begin declare @ObjectkeyOrdered varchar(138) declare 2@uid_accproduct varchar(38) declare @whereclauseOrg nvarchar(max) declare @whereclauseMuster nvarchar(max) = ' UID_ITShopOrg in ( select UID_OrgPR 3 from QER_VPWOProductNodesSlim 4 where ObjectkeyOrdered = ''@ObjectkeyOrdered'' 5 and isnull(UID_AccProduct, '''') <> ''@UID_AccProduct'' 6 ) 7' 8 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int BEGIN TRY if exists (select top 1 1 from inserted) goto start 9 if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') declare 10 @TSBAccountDefsToCheck QBM_YSingleGUID if update(isForITShop) or update(isITShopOnly) begin declare @FlagTest QBM_YParameterlist insert into @FlagTest 11(Parameter1, Parameter2, HasContentFull, e.Parameter3) select i.UID_TSBAccountDef, i.XObjectKey, i.IsForITShop, dbo.QBM_FCVBigIntToString(i.IsITShopOnly 12) from inserted i exec QER_PIsForITShopFlagCheck 'TSBAccountDef', @FlagTest end if update(PTDInheritAccountDef) or update(PFDInheritAccountDef) or update 13(PMDInheritAccountDef) or update(PSIInheritAccountDef) or update(UID_TSBAccountDefPredecessor) begin insert into @TSBAccountDefsToCheck(UID_SingleGuid 14) select r.uid_TSBAccountDef from TSBAccountDef r join deleted d on r.uid_TSBAccountDef = d.uid_TSBAccountDef where (isnull(r.PTDInheritAccountDef,0) <> 15 isnull(d.PTDInheritAccountDef,0) or isnull(r.PFDInheritAccountDef,0) <> isnull(d.PFDInheritAccountDef,0) or isnull(r.PMDInheritAccountDef,0) <> isnull 16(d.PMDInheritAccountDef,0) or isnull(r.PSIInheritAccountDef,0) <> isnull(d.PSIInheritAccountDef,0) or isnull(r.UID_TSBAccountDefPredecessor,'') <> isnull 17(d.UID_TSBAccountDefPredecessor,'') ) union select r.UID_TSBAccountDefPredecessor from TSBAccountDef r join deleted d on r.uid_TSBAccountDef = d.uid_TSBAccountDef 18 where isnull(r.UID_TSBAccountDefPredecessor,'') <> isnull(d.UID_TSBAccountDefPredecessor,'') and r.UID_TSBAccountDefPredecessor > ' ' union select d.UID_TSBAccountDefPredecessor 19 from TSBAccountDef r join deleted d on r.uid_TSBAccountDef = d.uid_TSBAccountDef where isnull(r.UID_TSBAccountDefPredecessor,'') <> isnull(d.UID_TSBAccountDefPredecessor 20,'') and d.UID_TSBAccountDefPredecessor > ' ' if 0 < (select count(*) from @TSBAccountDefsToCheck) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert 21 into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct a.UID_TSBAccountDef as uid from TSBAccountDef 22 a join @TSBAccountDefsToCheck c on a.UID_TSBAccountDefPredecessor = c.UID_SingleGuid ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-TSBAccountDefFlags', 23@DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID 24 from ( select distinct a.UID_Person as uid from PersonHasTSBAccountDef a join @TSBAccountDefsToCheck c on a.UID_TSBAccountDef = c.UID_SingleGuid ) as 25 x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasTSBAccountDef', @DBQueueElements_02 declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 26 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct a.UID_Org as uid from BaseTreeHasTSBAccountDef a join @TSBAccountDefsToCheck 27 c on a.UID_TSBAccountDef = c.UID_SingleGuid and a.XOrigin > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-OrgHasTSBAccountDef', @DBQueueElements_03 end 28 end if update(uid_accproduct) begin insert into @ElementBuffer(ObjectKey1, UID1) select x.XObjectKey, isnull(x.uid_accproduct,'') from TSBAccountDef 29 x join deleted d on x.uid_TSBAccountDef = d.uid_TSBAccountDef and isnull(x.uid_accproduct,'') <> isnull(d.uid_accproduct,'') and d.uid_accproduct > ' ' 30 join dialogColumn c on c.UID_DialogTable = 'QER-T-ITShopOrg' and c.columnname = 'uid_ACCProduct' and c.IsDeactivatedByPreProcessor = 0 select @ElementCount 31 = @@rowcount select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @ObjectkeyOrdered = bu.ObjectKey1 , @UID_AccProduct = bu.UID1 32 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex select @whereclauseOrg = @whereclauseMuster select @whereclauseOrg = replace(@whereclauseOrg 33, N'@ObjectkeyOrdered' , @ObjectkeyOrdered) select @whereclauseOrg = replace(@whereclauseOrg, N'@uid_accproduct' , rtrim(@uid_accproduct)) exec QBM_PJobCreate_HOUpdate_B 34 'ITShopOrg', @whereclauseOrg, @GenProcID , @p1 = 'uid_ACCProduct', @v1 = @uid_accproduct , @AdditionalObjectKeysAffected = DEFAULT select @ElementIndex 35 += 1 end end if update (UID_AccProduct) begin declare @RecalcParameter_OA QBM_YCursorBuffer insert into @RecalcParameter_OA (UID1, ObjectKey1, Ident1 36) select 'QER-PWODecisionRule-OA', a.XObjectKey, 'I' from inserted i join TSBAccountDef g on i.UID_TSBAccountDef = g.UID_TSBAccountDef join QERAccProductUsage 37 u on g.XObjectKey = u.XObjectKey join AccProduct a on u.UID_AccProduct = a.UID_AccProduct union select 'QER-PWODecisionRule-OA', a.XObjectKey, 'I' from 38 deleted d join TSBAccountDef g on d.UID_TSBAccountDef = g.UID_TSBAccountDef join QERAccProductUsage u on g.XObjectKey = u.XObjectKey join AccProduct a 39 on u.UID_AccProduct = a.UID_AccProduct exec QER_PITShopHelperFill_Recalc @RecalcParameter_OA, @GenprocID declare @RecalcParameter_OA2 QBM_YCursorBuffer 40 insert into @RecalcParameter_OA2 (UID1, ObjectKey1, Ident1) select 'QER-PWODecisionRule-OA', pwo.XObjectKey, 'I' from inserted i join TSBAccountDef g 41on i.UID_TSBAccountDef = g.UID_TSBAccountDef join AccProduct a on i.UID_AccProduct = a.UID_AccProduct join PersonWantsOrg pwo on g.XObjectKey = pwo.ObjectKeyElementUsedInAssign 42 union select 'QER-PWODecisionRule-OA', pwo.XObjectKey, 'I' from deleted d join TSBAccountDef g on d.UID_TSBAccountDef = g.UID_TSBAccountDef join AccProduct 43 a on d.UID_AccProduct = a.UID_AccProduct join PersonWantsOrg pwo on g.XObjectKey = pwo.ObjectKeyElementUsedInAssign exec QER_PITShopHelperFill_Recalc 44@RecalcParameter_OA2, @GenprocID end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 45 46
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.807
creates object-layer jobs via QBM_PJobCreate* inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QER_PIsForITShopFlagCheck, QBM_PDBQueueInsert_Bulk, QBM_PJobCreate_HOUpdate_B, QER_PITShopHelperFill_Recalc, QBM_PSessionErrorAdd; writes INSERT into, UPDATE not; reads/joins QER_VPWOProductNodesSlim, inserted, deleted, TSBAccountDef, PersonHasTSBAccountDef…
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
INSERT into UPDATE notCalled routines
Read/join references
SQL dependency metadata
- AccProduct
- BaseTreeHasTSBAccountDef
- deleted
- dialogColumn
- inserted
- PersonHasTSBAccountDef
- PersonWantsOrg
- QBM_PDBQueueInsert_Bulk
- QBM_PJobCreate_HOUpdate_B
- QBM_PSessionErrorAdd
- QBM_YCursorBuffer
- QBM_YDBQueueRaw
- QBM_YParameterlist
- QBM_YSingleGUID
- QER_PIsForITShopFlagCheck
- QER_PITShopHelperFill_Recalc
- QERAccProductUsage
- TSBAccountDef
- dbo.QBM_FCVBigIntToString
- dbo.QBM_FGISessionContext
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
TSB-K-TSBAccountDefFlags TSB-K-PersonHasTSBAccountDef TSB-K-OrgHasTSBAccountDefTemp tables / referenced variables
Temp: None extracted.
Variables: @ObjectkeyOrdered @uid_accproduct @whereclauseOrg @whereclauseMuster @UID_AccProduct @ElementBuffer @ElementCount @ElementIndex @GenProcID @TSBAccountDefsToCheck @FlagTest @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_03 @rowcount @p1 @v1 @AdditionalObjectKeysAffected @RecalcParameter_OA @GenprocID @RecalcParameter_OA2
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.