dbo.ADS_TUADSMachine

SQL_TRIGGER parent ADSMachine

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

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
ADSMachineOBJECT_OR_COLUMN
ADSMachineInADSGroupOBJECT_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_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_TUADSMachine on ADSMachine  for Update not for Replication as begin  declare @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin
2('|Direct|', 0)  declare @QBM_BitPatternXOrigin_Direct_inv int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 1)  declare @XUser nvarchar(64) = object_name
3(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted)
4 goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if update(UID_ADSGroupPrimary) begin declare
5 @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from (select a.UID_ADSMachine
6 as uid from ADSMachine a join deleted d on a.UID_ADSMachine = d.UID_ADSMachine where isnull(d.UID_ADSGroupPrimary, '') <> isnull(a.UID_ADSGroupPrimary
7, '') ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-ADSMachineInADSGroup', @DBQueueElements_01  if exists (select top 1 1 from deleted d join ADSMachine a
8 on d.UID_ADSMachine = a.UID_ADSMachine where isnull(d.UID_aDSGroupPrimary, '') <> isnull(a.UID_ADSGroupPrimary, '') ) begin if dbo.QBM_FGISessionContext
9 ('Fullsync') = '' begin update ADSMachineInADSGroup set XOrigin = aig.XOrigin | @QBM_BitPatternXOrigin_Direct , XIsInEffect = 1  , XDateUpdated = @Xdate
10 , XUserUpdated = @XUser from deleted d join ADSMachineInADSGroup aig on d.UID_ADSMachine = aig.UID_ADSMachine and d.UID_ADSGroupPrimary = aig.UID_ADSGroup
11 where aig.XIsInEffect = 0 end else begin  update ADSMachineInADSGroup set XOrigin = aig.XOrigin & @QBM_BitPatternXOrigin_Direct_inv  , XDateUpdated = 
12@Xdate , XUserUpdated = @XUser from deleted d join ADSMachineInADSGroup aig on d.UID_ADSMachine = aig.UID_ADSMachine and d.UID_ADSGroupPrimary = aig.UID_ADSGroup
13 where aig.XIsInEffect = 0 and aig.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 end end  end if update(ObjectSID) begin  if exists (select top 1 1 from 
14ADSMachine x join deleted d on x.uid_ADSMachine= d.uid_ADSMachine where isnull(d.ObjectSID, N'') <> isnull(x.ObjectSID, N'') ) begin insert into ADSOtherSID
15 (UID_ADSOtherSID, ObjectSID , DistinguishedName, canonicalName, Ident_ADSOtherSID , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated, XObjectKey
16) select x.UID_ADSOtherSID, x.ObjectSID , x.DistinguishedName, x.canonicalName, x.Ident_ADSOtherSID , x.XDateInserted, x.XDateUpdated, x.XUserInserted,
17 x.XUserUpdated, dbo.QBM_FCVElementToObjectKey1('ADSOtherSID', 'UID_ADSOtherSID', x.UID_ADSOtherSID) from ( select newid() as UID_ADSOtherSID, d.ObjectSID
18 , d.DistinguishedName, d.canonicalName, d.cn as Ident_ADSOtherSID , d.XDateInserted, d.XDateUpdated, d.XUserInserted, d.XUserUpdated from ADSMachine x
19 join deleted d on x.uid_ADSMachine= d.uid_ADSMachine where d.ObjectSID > ' ' and isnull(d.ObjectSID, N'') <> isnull(x.ObjectSID, N'') and not exists (select
20 top 1 1 from ADSOtherSID x where x.ObjectSID = d.ObjectSID ) ) as x end   if exists (select top 1 1 from ADSOtherSID a join inserted d on a.ObjectSID 
21= d.ObjectSID ) begin delete ADSOtherSID where objectSID in (select x.ObjectSID from ADSMachine x join deleted d on x.uid_ADSMachine = d.uid_ADSMachine
22 where isnull(x.ObjectSID, N'') <> isnull(d.ObjectSID, N'') ) and UID_ADSOtherSID not like 'ADS-%' end  end  if update(UID_Hardware) begin declare @DBQueueElements_02
23 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select d.UID_ADSMachine as uid from
24 deleted d join ADSMachine m on d.UID_ADSMachine = m.UID_ADSMachine where isnull(d.UID_Hardware, '') <> isnull(m.UID_Hardware, '') ) as x exec QBM_PDBQueueInsert_Bulk
25 'ADS-K-ADSMachineInADSGroup', @DBQueueElements_02 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH
26 ende: return end 
27

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

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

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, INSERT ADSOtherSID, UPDATE not, UPDATE ADSMachineInADSGroup, DELETE ADSOtherSID; reads/joins inserted, deleted, ADSMachine, ADSMachineInADSGroup, ADSOtherSID; uses session context Fullsync

Declared parameters

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

DML targets

INSERT into INSERT ADSOtherSID UPDATE not UPDATE ADSMachineInADSGroup DELETE ADSOtherSID

Config/session

Config: None extracted.

Session: Fullsync

DBQueue/tasks

ADS-K-ADSMachineInADSGroup

Temp tables / referenced variables

Temp: None extracted.

Variables: @QBM_BitPatternXOrigin_Direct @QBM_BitPatternXOrigin_Direct_inv @XUser @procid @Xdate @GenProcID @DBQueueElements_01 @DBQueueElements_02

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.