Back to OIM Explorer

dbo.ADS_TIAdsGroup

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on ADSGroup. Bulk DBQueue insert -> ADS-K-ADSGroupInADSGroup / ADS_ZGroupInADSGroup at line 5; References QBM_PDBQueueInsert_Bulk; Trigger parent table: ADSGroup

Source: sandbox-db sys.sql_modules

Source size: 875 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-ADSGroupInADSGroup / ADS_ZGroupInADSGroup at line 5
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: ADSGroup

Typed Edges

  • queues DBQueue task ADS_ZGroupInADSGroup at line 5 Bulk DBQueue insert -> ADS-K-ADSGroupInADSGroup / ADS_ZGroupInADSGroup at line 5
  • trigger on table ADSGroup Trigger parent table: ADSGroup
  • 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

SQL50 lines
1CREATE trigger ADS_TIAdsGroup2  ON AdsGroup FOR3INSERT NOT FOR Replication4AS5BEGIN6  DECLARE @errno int7  BEGIN TRY8    IF EXISTS(9      SELECT TOP 1 110      FROM inserted)11    GOTO start12    RETURN start:13    DECLARE @GenProcID varchar(38)14    SELECT @GenProcID = dbo.QBM_FGISessionContext('')15    IF EXISTS(16      SELECT TOP 1 117      FROM ADSOtherSID a18      JOIN inserted d19        ON a.ObjectSID = d.ObjectSID)20    BEGIN21      DELETE ADSOtherSID22      WHERE23        objectSID IN(24      SELECT ObjectSID25      FROM inserted) AND UID_ADSOtherSID NOT LIKE 'ADS-%'26    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    SELECT uid_ADSGroup AS uid37    FROM inserted) AS x38    EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-ADSGroupInADSGroup',39      @DBQueueElements_0140  END TRY41  BEGIN CATCH42    EXEC QBM_PSessionErrorAdd DEFAULT43    RAISERROR('',44    18,45    1)46      WITH NOWAIT47  END CATCH48  ende:49  RETURN50END
Open raw exported source
SQL ยท Raw7 lines
1create   trigger ADS_TIAdsGroup on AdsGroup  for Insert not for Replication as begin  declare @errno int BEGIN TRY if exists (select top 1 1 from2 inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')   if exists (select top 1 1 from ADSOtherSID3 a join inserted d on a.ObjectSID = d.ObjectSID ) begin delete ADSOtherSID where objectSID in (select ObjectSID from inserted ) and UID_ADSOtherSID not4 like 'ADS-%'  end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID5 from ( select uid_ADSGroup as uid from inserted ) as x exec QBM_PDBQueueInsert_Bulk 'ADS-K-ADSGroupInADSGroup', @DBQueueElements_01  END TRY BEGIN CATCH6 exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 7