Back to OIM Explorer

dbo.ADS_TIADSAccount

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on ADSAccount. Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 7; Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 7; Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 9; References QBM_PDBQueueInsert_Bulk

Source: sandbox-db sys.sql_modules

Source size: 1.520 characters

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 7
  • Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 7
  • Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 9
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: ADSAccount

Typed Edges

  • queues DBQueue task ADS_ZPersonHasObject at line 7 Bulk DBQueue insert -> ADS-K-PersonHasObject / ADS_ZPersonHasObject at line 7
  • queues DBQueue task ADS_ZAccountInADSGroup at line 7 Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 7
  • queues DBQueue task ADS_ZAccountInADSGroup at line 9 Bulk DBQueue insert -> ADS-K-ADSAccountInADSGroup / ADS_ZAccountInADSGroup at line 9
  • trigger on table ADSAccount Trigger parent table: ADSAccount
  • 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

Complete Source

SQL80 lines
1CREATE trigger ADS_TIADSAccount2  ON ADSAccount FOR3INSERT NOT FOR Replication4AS5BEGIN6  IF EXISTS(7    SELECT TOP 1 18    FROM inserted)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 inserted i17      JOIN ADSGroup g18        ON i.UID_ADSGroupPrimary = g.UID_ADSGroup19      WHERE20        g.IsITshopOnly = 1)21    BEGIN22      RAISERROR('#LDS#The definition of a group as "IsITshopOnly = 1" and simultaneous use as primary group is not allowed.|',23      18,24      2)25        WITH nowait26    END27    IF EXISTS(28      SELECT TOP 1 129      FROM ADSOtherSID a30      JOIN inserted d31        ON a.ObjectSID = d.ObjectSID)32    BEGIN33      DELETE ADSOtherSID34      WHERE35        objectSID IN(36      SELECT ObjectSID37      FROM inserted) AND UID_ADSOtherSID NOT LIKE 'ADS-%'38    END39    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw40    INSERT INTO @DBQueueElements_01(object,41    subobject,42    genprocid)43    SELECT44      x.uid,45      NULL,46      @GenProcID47    FROM(48    SELECT49      DISTINCT uid_person AS uid50    FROM inserted51    WHERE52      uid_person > ' ') AS x53    EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject',54      @DBQueueElements_0155    DECLARE @DBQueueElements_03 QBM_YDBQueueRaw56    INSERT INTO @DBQueueElements_03(object,57    subobject,58    genprocid)59    SELECT60      x.uid,61      NULL,62      @GenProcID63    FROM(64    SELECT65      DISTINCT i.UID_ADSAccount AS uid66    FROM inserted i67    WHERE68      i.UID_ADSGroupPrimary > ' ' OR i.UID_Person > ' ') AS x69    EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-ADSAccountInADSGroup',70      @DBQueueElements_0371  END TRY72  BEGIN CATCH73    EXEC QBM_PSessionErrorAdd DEFAULT74    RAISERROR('',75    18,76    1)77      WITH NOWAIT78  END CATCH79  RETURN80END
Open raw exported source
SQL ยท Raw11 lines
1     create   trigger ADS_TIADSAccount on ADSAccount  for Insert not for Replication as begin  if exists (select top 1 1 from inserted) goto start2 return start: declare @GenProcID varchar(38) BEGIN TRY select @GenProcID = dbo.QBM_FGISessionContext('')   if exists (select top 1 1 from inserted i join3 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.|'4, 18, 2) with nowait end   if exists (select top 1 1 from ADSOtherSID a join inserted d on a.ObjectSID = d.ObjectSID ) begin delete ADSOtherSID where objectSID5 in (select ObjectSID from inserted ) and UID_ADSOtherSID not like 'ADS-%' end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_016 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct uid_person as uid from inserted where uid_person > ' ' ) as x exec7 QBM_PDBQueueInsert_Bulk 'ADS-K-PersonHasObject', @DBQueueElements_01    declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object8, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.UID_ADSAccount as uid from inserted i where i.UID_ADSGroupPrimary > ' '9  or i.UID_Person > ' ' ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-ADSAccountInADSGroup', @DBQueueElements_03  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd10 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH return end 11