dbo.LDP_TDLDAPAccount
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 -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 5
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: LDAPAccount
Typed Edges
- queues DBQueue task LDP_ZPersonHasObject at line 5 Bulk DBQueue insert -> LDP-K-PersonHasObject / LDP_ZPersonHasObject at line 5
- trigger on table LDAPAccount Trigger parent table: LDAPAccount
- 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 LDP_TDLDAPAccount2 ON LDAPAccount FOR3DELETE NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM deleted)10 GOTO start11 RETURN start:12 DECLARE @GenProcID varchar(38)13 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 'LDP-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 LDP_TDLDAPAccount on LDAPAccount for Delete not for Replication as begin BEGIN TRY if exists (select top 1 1 from deleted) goto2 start return start: declare @GenProcID varchar(38) 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 'LDP-K-PersonHasObject', 6@DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7