dbo.TSB_TUUNSAccountBInUNSGroupB1

SQL_TRIGGER parent UNSAccountBInUNSGroupB1

Created 2025-06-27T18:01:21.757 · modified 2026-04-14T23:23:08.860 · 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
UNSAccountBInUNSGroupB1OBJECT_OR_COLUMN
UNSGroupB1OBJECT_OR_COLUMN
UNSItemBOBJECT_OR_COLUMN
dboQBM_FGIBitPatternXMarkedForDelOBJECT_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_TUUNSAccountBInUNSGroupB1 on UNSAccountBInUNSGroupB1  for Update not for Replication as begin  declare @GenProcID varchar
2(38) declare @XUser nvarchar(64) declare @QBM_BitPatternXMarkedForDel_OutStanding int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|', 0)  BEGIN TRY
3 if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: select @GenProcID = dbo.QBM_FGISessionContext
4('') select @XUser = dbo.QBM_FGISessionContext('XUser') if update(XOrigin) or update(XIsInEffect) begin  if exists (select top 1 1 from deleted d join 
5UNSAccountBInUNSGroupB1 dd on d.XObjectKey = dd.XObjectKey join UNSGroupB1 g on d.UID_UNSGroupB1 = g.UID_UNSGroupB1 where g.HasReadOnlyMemberships
6 = 1 and d.XOrigin <> dd.XOrigin and dbo.QBM_FGISessionContext ('Fullsync') = '' and exists (select top 1 1 from UNSAccountB a where a.UID_UNSAccountB 
7= d.UID_UNSAccountB and a.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0 ) ) begin raiserror( '#LDS#Cannot update {0} because it is assignment to group with read only memberships.|UNSAccountBInUNSGroupB1|'
8, 18, 2) with nowait end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null
9, @GenProcID from ( select distinct d.UID_UNSAccountB as uid from deleted d join UNSAccountBInUNSGroupB1 dd on d.XObjectKey = dd.XObjectKey where dbo.QBM_FGIXOriginChanged_Except2
10(d.XOrigin, dd.XOrigin) = 1  or (d.XIsInEffect <> dd.XIsInEffect and dbo.QBM_FGISessionContext ('Fullsync') > ' ' ) ) as x exec QBM_PDBQueueInsert_Bulk
11 'TSB-K-UNSAccountBInUNSGroupB1', @DBQueueElements_01 end  if update(XIsInEffect) or update(XOrigin) begin declare @DBQueueElements_02 QBM_YDBQueueRaw
12 insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct x.UID_Person as uid from UNSAccountBInUNSGroupB1
13 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
14(d.XOrigin, a.XOrigin, d.XIsInEffect, a.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(a.XOrigin) ) 
15) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_02  if '1' = dbo.QBM_FGIConfigparmValue('QER\ComplianceCheck\IncludeTSBPersonUsesAccount'
16) begin declare @DBQueueElements_PersonUsesAccount QBM_YDBQueueRaw insert into @DBQueueElements_PersonUsesAccount (object, subobject, genprocid) select
17 x.uid, null, @GenProcID from ( select distinct t.uid_person as uid from UNSAccountBInUNSGroupB1 aig join deleted d on aig.XObjectKey = d.XObjectKey 
18join UNSAccountB a on aig.UID_UNSAccountB = a.UID_UNSAccountB join TSBPersonUsesAccount t on a.XObjectKey = t.ObjectKeyAccount where ( dbo.QBM_FGIXOriginChanged_Effect
19(d.XOrigin, aig.XOrigin, d.XIsInEffect, aig.XIsInEffect) = 1 or dbo.QER_FCVXOriginToInheritInfo(d.XOrigin) <> dbo.QER_FCVXOriginToInheritInfo(aig.XOrigin
20) ) ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-PersonHasObject', @DBQueueElements_PersonUsesAccount end  if 'UNSGroupB1' = 'UNSGroupB'  begin if exists
21 (select top 1 1 from UNSItemB ) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select
22 x.uid, null, @GenProcID from ( select distinct d.UID_UNSAccountB as uid from UNSAccountBInUNSGroupB1 a join deleted d on a.XObjectKey = d.XObjectKey
23 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
24 b on acc.UID_UNSRootB = b.UID_UNSRootB and acc.UID_UNSAccountB = a.UID_UNSAccountB) ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBHasUNSItemB'
25, @DBQueueElements_03 end end end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 
26

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

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, UNSAccountBInUNSGroupB1, UNSGroupB1, UNSAccountB…; 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-UNSAccountBInUNSGroupB1 TSB-K-PersonHasObject TSB-K-UNSAccountBHasUNSItemB

Temp tables / referenced variables

Temp: #LDS #Cannot

Variables: @GenProcID @XUser @QBM_BitPatternXMarkedForDel_OutStanding @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.