dbo.ADS_TDADSAccount

SQL_TRIGGER parent ADSAccount

Created 2025-06-27T18:01:23.357 · 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
ADSOtherSIDOBJECT_OR_COLUMN
deletedOBJECT_OR_COLUMN
PersonHasTSBAccountDefOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
dboQBM_FCVElementToObjectKey1OBJECT_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_TDADSAccount on ADSAccount  for DELETE not for Replication as begin  if exists (select top 1 1 from deleted) goto start return
2 start: declare @GenProcID varchar(38) BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('')  if exists (select top 1 1 from deleted d join PersonHasTSBAccountDef
3 pha on d.UID_Person = pha.UID_Person and d.UID_TSBAccountDef = pha.UID_TSBAccountDef where pha.XOrigin > 0 and pha.XIsInEffect = 1  ) begin raiserror(
4'#LDS#Delete Accounts with existing PersonHasTSBAccountDef is not permitted.|', 18, 1) with nowait end   if exists (select top 1 1 from deleted d where
5 d.ObjectSID > ' ' ) begin insert into ADSOtherSID (UID_ADSOtherSID, ObjectSID , DistinguishedName, canonicalName, Ident_ADSOtherSID , XDateInserted, XDateUpdated
6, XUserInserted, XUserUpdated, XObjectKey) select x.UID_ADSOtherSID, x.ObjectSID , x.DistinguishedName, x.canonicalName, x.Ident_ADSOtherSID , x.XDateInserted
7, x.XDateUpdated, x.XUserInserted, x.XUserUpdated, dbo.QBM_FCVElementToObjectKey1('ADSOtherSID', 'UID_ADSOtherSID', x.UID_ADSOtherSID) from ( select newid
8() as UID_ADSOtherSID, d.ObjectSID , d.DistinguishedName, d.canonicalName, d.cn as Ident_ADSOtherSID , d.XDateInserted, d.XDateUpdated, d.XUserInserted
9, d.XUserUpdated from deleted d where d.ObjectSID > ' ' and not exists (select top 1 1 from ADSOtherSID x where x.ObjectSID = d.ObjectSID ) ) as x end 
10   declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select
11 distinct uid_person as uid from deleted where uid_person > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject', @DBQueueElements_01 END TRY
12 BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 
13

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, DELETE not, DELETE Accounts; reads/joins deleted, PersonHasTSBAccountDef, ADSOtherSID

Declared parameters

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

DML targets

INSERT ADSOtherSID INSERT into DELETE not DELETE Accounts

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

ADS-K-PersonHasObject

Temp tables / referenced variables

Temp: #LDS #Delete

Variables: @GenProcID @DBQueueElements_01

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.