dbo.TSB_TUUNSAccountBHasUNSGroupB2

SQL_TRIGGER parent UNSAccountBHasUNSGroupB2

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

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
deletedOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
TSBPersonUsesAccountOBJECT_OR_COLUMN
UNSAccountBOBJECT_OR_COLUMN
UNSAccountBHasUNSGroupB2OBJECT_OR_COLUMN
UNSItemBOBJECT_OR_COLUMN
dboQBM_FGIConfigparmValueOBJECT_OR_COLUMN
dboQBM_FGISessionContextOBJECT_OR_COLUMN
dboQBM_FGIXOriginChanged_EffectOBJECT_OR_COLUMN
dboQBM_FGIXOriginChanged_Except2OBJECT_OR_COLUMN
dboQER_FCVXOriginToInheritInfoOBJECT_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 TSB_TUUNSAccountBHasUNSGroupB2 on UNSAccountBHasUNSGroupB2  for Update not for Replication as begin  declare @GenProcID varchar
2(38) declare @XUser nvarchar(64) BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return
3 start: select @GenProcID = dbo.QBM_FGISessionContext('') select @XUser = dbo.QBM_FGISessionContext('XUser') if update(XOrigin) or update(XIsInEffect) 
4begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( 
5select distinct d.UID_UNSAccountB as uid from deleted d join UNSAccountBHasUNSGroupB2 dd on d.XObjectKey = dd.XObjectKey where dbo.QBM_FGIXOriginChanged_Except2
6(d.XOrigin, dd.XOrigin) = 1  or (d.XIsInEffect <> dd.XIsInEffect and dbo.QBM_FGISessionContext ('Fullsync') > ' ' ) ) as x exec QBM_PDBQueueInsert_Bulk
7 'TSB-K-UNSAccountBInUNSGroupB2', @DBQueueElements_01 end  if update(XIsInEffect) or update(XOrigin) begin declare @DBQueueElements_02 QBM_YDBQueueRaw
8 insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct x.UID_Person as uid from UNSAccountBHasUNSGroupB2
9 a join deleted d on a.XObjectKey = d.XObjectKey join UNSAccountB x on a.UID_UNSAccountB = x.UID_UNSAccountB where x.UID_Person > ' ' and ( dbo.QBM_FGIXOriginChanged_Effect
10(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin) ) 
11) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_02  if '1' = dbo.QBM_FGIConfigparmValue('QER\ComplianceCheck\IncludeTSBPersonUsesAccount'
12) begin declare @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw insert into @DBQueueElements_PersonUsesAccount (object, subobject, genprocid) select
13 x.uid, null, @GenProcID from ( select distinct t.uid_person as uid from UNSAccountBHasUNSGroupB2 aig join deleted d on aig.XObjectKey = d.XObjectKey
14 join UNSAccountB a on aig.UID_UNSAccountB = a.UID_UNSAccountB join TSBPersonUsesAccount t on a.XObjectKey = t.ObjectKeyAccount where ( dbo.QBM_FGIXOriginChanged_Effect
15(d.XOrigin, aig.XOrigin, d.XIsInEffect, aig.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(aig.XOrigin
16) ) ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_PersonUsesAccount end  if 'UNSGroupB2' = 'UNSGroupB'  begin if exists
17 (select top 1 1 from UNSItemB ) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select
18 x.uid, null, @GenProcID from ( select distinct d.UID_UNSAccountB as uid from UNSAccountBHasUNSGroupB2 a join deleted d on a.XObjectKey = d.XObjectKey
19 and dbo.QBM_FGIXOriginChanged_Effect(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 where exists (select top 1 1 from UNSAccountB acc join UNSItemB
20 b on acc.UID_UNSRootB = b.UID_UNSRootB and acc.UID_UNSAccountB = a.UID_UNSAccountB) ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBHasUNSItemB'
21, @DBQueueElements_03 end end end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 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:08.847

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

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, UPDATE not; reads/joins inserted, deleted, UNSAccountBHasUNSGroupB2, UNSAccountB, TSBPersonUsesAccount…; uses config QER\ComplianceCheck\IncludeTSBPersonUsesAccount; uses session context XUser, Fullsync

Declared parameters

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

DML targets

INSERT into UPDATE not

Config/session

Config: QER\ComplianceCheck\IncludeTSBPersonUsesAccount

Session: XUser Fullsync

DBQueue/tasks

TSB-K-UNSAccountBInUNSGroupB2 TSB-K-PersonHasObject TSB-K-UNSAccountBHasUNSItemB

Temp tables / referenced variables

Temp: None extracted.

Variables: @GenProcID @XUser @DBQueueElements_01 @DBQueueElements_02 @DBQueueElements_PersonUsesAccount @DBQueueElements_03

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.