dbo.ADS_TUADSAccount

SQL_TRIGGER parent ADSAccount

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

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
ADSAccountOBJECT_OR_COLUMN
ADSAccountInADSGroupOBJECT_OR_COLUMN
ADSGroupOBJECT_OR_COLUMN
ADSOtherSIDOBJECT_OR_COLUMN
deletedOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
dboQBM_FCVElementToObjectKey1OBJECT_OR_COLUMN
dboQBM_FGIBitPatternXMarkedForDelOBJECT_OR_COLUMN
dboQBM_FGIBitPatternXOriginOBJECT_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 ADS_TUADSAccount on ADSAccount  for Update not for Replication as begin  if exists (select top 1 1 from inserted) goto start if
2 exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) declare @parameter nvarchar(1024) declare @QBM_BitPatternXMarkedForDel_OutStanding
3 int = dbo.QBM_FGIBitPatternXMarkedForDel('|OutStanding|', 0)  declare @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) 
4 declare @QBM_BitPatternXOrigin_Direct_inv int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 1)  declare @XUser nvarchar(64) = object_name(@@procid) declare
5 @Xdate datetime = getutcdate() BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('')  if update (UID_ADSGroupPrimary) begin if exists (select top
6 1 1 from inserted i join ADSGroup g on i.UID_ADSGroupPrimary = g.UID_ADSGroup where g.IsITshopOnly = 1 ) begin raiserror( '#LDS#The definition of a group as "IsITshopOnly = 1" and simultaneous use as primary group is not allowed.|'
7, 18, 2) with nowait end  if exists (select top 1 1 from deleted d join ADSAccount a on d.UID_ADSAccount = a.UID_ADSAccount where isnull(d.UID_aDSGroupPrimary
8, '') <> isnull(a.UID_ADSGroupPrimary, '') ) begin if dbo.QBM_FGISessionContext ('Fullsync') = '' begin update ADSAccountInADSGroup set XOrigin = case 
9when d.UID_ADSDomain = aneu.UID_ADSDomain then aig.XOrigin | @QBM_BitPatternXOrigin_Direct  else 0  end , XIsInEffect = case when d.UID_ADSDomain = aneu.UID_ADSDomain
10 then 1  else 0  end  , XDateUpdated = @Xdate , XUserUpdated = @XUser from deleted d join ADSAccountInADSGroup aig on d.UID_ADSAccount = aig.UID_ADSAccount
11 and d.UID_ADSGroupPrimary = aig.UID_ADSGroup join ADSAccount aneu on d.UID_ADSAccount = aneu.UID_ADSAccount where aig.XIsInEffect = 0 end else begin  
12update ADSAccountInADSGroup set XOrigin = aig.XOrigin & @QBM_BitPatternXOrigin_Direct_inv  , XDateUpdated = @Xdate , XUserUpdated = @XUser from deleted
13 d join ADSAccountInADSGroup aig on d.UID_ADSAccount = aig.UID_ADSAccount and d.UID_ADSGroupPrimary = aig.UID_ADSGroup where aig.XIsInEffect = 0 and aig.XOrigin
14 & @QBM_BitPatternXOrigin_Direct > 0 end end  end if update(ObjectSID) begin  if exists (select top 1 1 from ADSAccount x join deleted d on x.uid_ADSAccount=
15 d.uid_ADSAccount where isnull(d.ObjectSID, N'') <> isnull(x.ObjectSID, N'') ) begin insert into ADSOtherSID (UID_ADSOtherSID, ObjectSID , DistinguishedName
16, canonicalName, Ident_ADSOtherSID , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated, XObjectKey) select x.UID_ADSOtherSID, x.ObjectSID , x.DistinguishedName
17, x.CanonicalName, x.Ident_ADSOtherSID , x.XDateInserted, x.XDateUpdated, x.XUserInserted, x.XUserUpdated, dbo.QBM_FCVElementToObjectKey1('ADSOtherSID'
18, 'UID_ADSOtherSID', x.UID_ADSOtherSID) from (select newid() as UID_ADSOtherSID, d.ObjectSID , d.DistinguishedName, d.canonicalName, d.cn as Ident_ADSOtherSID
19 , d.XDateInserted, d.XDateUpdated, d.XUserInserted, d.XUserUpdated from ADSAccount x join deleted d on x.uid_ADSAccount= d.uid_ADSAccount where d.ObjectSID
20 > ' ' and isnull(d.ObjectSID, N'') <> isnull(x.ObjectSID, N'') and not exists (select top 1 1 from ADSOtherSID x where x.ObjectSID = d.ObjectSID ) ) as
21 x end   if exists (select top 1 1 from ADSOtherSID a join inserted d on a.ObjectSID = d.ObjectSID ) begin delete ADSOtherSID where objectSID in (select
22 x.ObjectSID from ADSAccount x join deleted d on x.uid_ADSAccount = d.uid_ADSAccount where isnull(x.ObjectSID, N'') <> isnull(d.ObjectSID, N'') ) and UID_ADSOtherSID
23 not like 'ADS-%'  end  end  if update(UID_Person) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject
24, genprocid) select x.uid, null, @GenProcID from ( select uid_person as uid from inserted where uid_person > ' ' union select uid_person from deleted where
25 uid_person > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject', @DBQueueElements_01   end if  update(UID_Person) or update(IsGroupAccount
26)  or update(UID_TSBBehavior)  or update(UID_ADSGroupPrimary) or update(MatchPatternForMembership) or update(AccountDisabled)  or update(objectclass)  
27or update(XMarkedForDeletion) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select x.uid
28, null, @GenProcID from (select a.UID_ADSAccount as uid from ADSAccount a join deleted d on a.UID_ADSAccount = d.UID_ADSAccount where   isnull(d.UID_Person
29,'') <> isnull(a.UID_Person,'') or isnull(d.IsGroupAccount,0) <> isnull(a.IsGroupAccount,0)  or isnull(d.UID_TSBBehavior,'') <> isnull(a.UID_TSBBehavior
30,'')  or isnull(d.MatchPatternForMembership,0) <> isnull(a.MatchPatternForMembership,0) or isnull(d.AccountDisabled,0) <> isnull(a.AccountDisabled,0)  
31or isnull(d.UID_ADSGroupPrimary, '') <> isnull(a.UID_ADSGroupPrimary, '')  or isnull(d.objectclass,'') <> isnull(a.objectclass,'')  or (d.XMarkedForDeletion
32 ^ a.XMarkedForDeletion ) & @QBM_BitPatternXMarkedForDel_OutStanding > 0 ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-ADSAccountInADSGroup', @DBQueueElements_03
33 end  if update(XMarkedForDeletion) and dbo.QBM_FGISessionContext ('Fullsync') > ' ' begin update ADSAccountInADSGroup set XMarkedForDeletion = aig.XMarkedForDeletion
34 | @QBM_BitPatternXMarkedForDel_OutStanding  , XDateUpdated = @Xdate , XUserUpdated = @XUser from deleted d join ADSAccount a on d.UID_ADSAccount = a.UID_ADSAccount
35 join ADSAccountInADSGroup aig on d.UID_ADSAccount = aig.UID_ADSAccount where d.XMarkedForDeletion & @QBM_BitPatternXMarkedForDel_OutStanding = 0 and a.XMarkedForDeletion
36 & @QBM_BitPatternXMarkedForDel_OutStanding > 0 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH  
37return end 
38

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

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

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT ADSOtherSID, INSERT into, UPDATE not, UPDATE ADSAccountInADSGroup, DELETE ADSOtherSID; reads/joins inserted, deleted, ADSGroup, ADSAccount, ADSAccountInADSGroup…; uses session context Fullsync

Declared parameters

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

DML targets

INSERT ADSOtherSID INSERT into UPDATE not UPDATE ADSAccountInADSGroup DELETE ADSOtherSID

Config/session

Config: None extracted.

Session: Fullsync

DBQueue/tasks

ADS-K-PersonHasObject ADS-K-ADSAccountInADSGroup

Temp tables / referenced variables

Temp: #LDS #The

Variables: @GenProcID @parameter @QBM_BitPatternXMarkedForDel_OutStanding @QBM_BitPatternXOrigin_Direct @QBM_BitPatternXOrigin_Direct_inv @XUser @procid @Xdate @DBQueueElements_01 @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.