Back to OIM Explorer

dbo.ADS_TIADSMachineInADSGroup

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on ADSMachineInADSGroup. Bulk DBQueue insert -> ADS-K-ADSMachineInADSGroup / ADS_ZADSMachineInADSGroup at line 10; References QBM_PDBQueueInsert_Bulk; Trigger parent table: ADSMachineInADSGroup

Source: sandbox-db sys.sql_modules

Source size: 1.804 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-ADSMachineInADSGroup / ADS_ZADSMachineInADSGroup at line 10
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: ADSMachineInADSGroup

Typed Edges

  • queues DBQueue task ADS_ZADSMachineInADSGroup at line 10 Bulk DBQueue insert -> ADS-K-ADSMachineInADSGroup / ADS_ZADSMachineInADSGroup at line 10
  • trigger on table ADSMachineInADSGroup Trigger parent table: ADSMachineInADSGroup
  • references source dbo.QBM_FGIBitPatternXOrigin source text reference
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QER_FGIITShopFlagCombineValid source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference
  • references source dbo.ADS_TIADSMachine source text reference

Complete Source

SQL71 lines
1CREATE trigger ADS_TIADSMachineInADSGroup2  ON ADSMachineInADSGroup FOR3INSERT NOT FOR Replication4AS5BEGIN6  DECLARE @GenProcID varchar(38)7  DECLARE @XUser nvarchar(64)8  DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',9  0)10  DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',11  1)12  BEGIN TRY13    IF EXISTS(14      SELECT TOP 1 115      FROM inserted)16    GOTO start17    RETURN start:18    SELECT @GenProcID = dbo.QBM_FGISessionContext('')19    SELECT @XUser = dbo.QBM_FGISessionContext('XUser')20    IF EXISTS(21      SELECT TOP 1 122      FROM inserted i23      JOIN ADSGroup elem24        ON i.uid_ADSGroup = elem.uid_ADSGroup25      WHERE26        dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct27    > 0 AND dbo.QBM_FGISessionContext('Fullsync') = '')28    BEGIN29      RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',30      18,31      2)32        WITH nowait33    END34    IF EXISTS(35      SELECT TOP 1 136      FROM inserted i37      JOIN ADSGroup g38        ON i.UID_ADSGroup = g.UID_ADSGroup AND 1 = g.HasReadOnlyMemberships AND dbo.QBM_FGISessionContext('Fullsync') = '')39    BEGIN40      RAISERROR('#LDS#Cannot add {0} because assignment to groups with read only memberships are not permitted.|ADSMachineInADSGroup|',41      18,42      2)43        WITH nowait44    END45    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw46    INSERT INTO @DBQueueElements_01(object,47    subobject,48    genprocid)49    SELECT50      x.uid,51      NULL,52      @GenProcID53    FROM(54    SELECT55      DISTINCT i.UID_ADSMachine AS uid56    FROM inserted i57    WHERE58      i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x59    EXEC QBM_PDBQueueInsert_Bulk 'ADS-K-ADSMachineInADSGroup',60      @DBQueueElements_0161  END TRY62  BEGIN CATCH63    EXEC QBM_PSessionErrorAdd DEFAULT64    RAISERROR('',65    18,66    1)67      WITH NOWAIT68  END CATCH69  ende:70  RETURN71END
Open raw exported source
SQL ยท Raw13 lines
1    create   trigger ADS_TIADSMachineInADSGroup on ADSMachineInADSGroup  for Insert not for Replication as begin  declare @GenProcID varchar(38)2 declare @XUser nvarchar(64) declare @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv3 int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1)  BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: select @GenProcID = dbo.QBM_FGISessionContext4('') select @XUser = dbo.QBM_FGISessionContext('XUser')  if exists (select top 1 1 from inserted i   join ADSGroup elem on i.uid_ADSGroup = elem.uid_ADSGroup5 where dbo.QER_FGIITShopFlagCombineValid (i.XObjectKey, null, null, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0  and i.XOrigin & @QBM_BitPatternXOrigin_Direct6 > 0 and dbo.QBM_FGISessionContext ('Fullsync') = '' ) begin  raiserror ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|', 718, 2) with nowait end  if exists (select top 1 1 from inserted i join ADSGroup g on i.UID_ADSGroup = g.UID_ADSGroup and 1 = g.HasReadOnlyMemberships and8 dbo.QBM_FGISessionContext ('Fullsync') = '' ) begin raiserror( '#LDS#Cannot add {0} because assignment to groups with read only memberships are not permitted.|ADSMachineInADSGroup|'9, 18, 2) with nowait end   declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null10, @GenProcID from ( select distinct i.UID_ADSMachine as uid from inserted i   where i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk11 'ADS-K-ADSMachineInADSGroup', @DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende:12 return end 13