dbo.ADS_TDADSContact
Database TriggerSQL_TRIGGERSandbox DB
Interpretation
- Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
- DBQueue relation detected. Follow the task procedure and referenced-by list for async processing.
Relations
- Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 5
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: ADSContact
Typed Edges
- queues DBQueue task ADS_ZPersonHasObject at line 5 Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 5
- trigger on table ADSContact Trigger parent table: ADSContact
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_PDBQueueInsert_Bulk source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger ADS_TDADSContact2 ON ADSContact FOR3DELETE NOT FOR Replication4AS5BEGIN6 IF EXISTS(7 SELECT TOP 1 18 FROM deleted)9 GOTO start10 RETURN start:11 DECLARE @GenProcID varchar(38)12 BEGIN TRY13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 IF EXISTS(15 SELECT TOP 1 116 FROM deleted d17 JOIN PersonHasTSBAccountDef pha18 ON d.XObjectKey = pha.XObjectKey19 WHERE20 pha.XOrigin > 0 AND pha.XIsInEffect = 1)21 BEGIN22 RAISERROR('#LDS#Delete Accounts with existing PersonHasTSBAccountDef is not permitted.|',23 18,24 1)25 WITH nowait26 END27 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw28 INSERT INTO @DBQueueElements_01(object,29 subobject,30 genprocid)31 SELECT32 x.uid,33 NULL,34 @GenProcID35 FROM(36 SELECT37 DISTINCT uid_person AS uid38 FROM deleted39 WHERE40 uid_person > ' ') AS x41 EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject',42 @DBQueueElements_0143 END TRY44 BEGIN CATCH45 EXEC QBM_PSessionErrorAdd DEFAULT46 RAISERROR('',47 18,48 1)49 WITH NOWAIT50 END CATCH51 ende:52 RETURN53END
Open raw exported source
1create trigger ADS_TDADSContact on ADSContact for DELETE not for Replication as begin if exists (select top 1 1 from deleted) goto start return2 start: declare @GenProcID varchar(38) BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('') if exists (select top 1 1 from deleted d join PersonHasTSBAccountDef3 pha on d.XObjectKey = pha.XObjectKey where pha.XOrigin > 0 and pha.XIsInEffect = 1 ) begin raiserror('#LDS#Delete Accounts with existing PersonHasTSBAccountDef is not permitted.|'4, 18, 1) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null5, @GenProcID from ( select distinct uid_person as uid from deleted where uid_person > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject', 6@DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7