Back to OIM Explorer

dbo.LDP_TUTSBSpecificGroupBehavior

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on TSBSpecificGroupBehavior. Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 11; References QBM_PDBQueueInsert_Bulk; Trigger parent table: TSBSpecificGroupBehavior

Source: sandbox-db sys.sql_modules

Source size: 1.913 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 -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 11
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: TSBSpecificGroupBehavior

Typed Edges

  • queues DBQueue task LDP_ZAccountInLDAPGroup at line 11 Bulk DBQueue insert -> LDP-K-LDAPAccountInLDAPGroup / LDP_ZAccountInLDAPGroup at line 11
  • trigger on table TSBSpecificGroupBehavior Trigger parent table: TSBSpecificGroupBehavior
  • 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

SQL82 lines
1CREATE trigger LDP_TUTSBSpecificGroupBehavior2  ON TSBSpecificGroupBehavior FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')7  DECLARE @ReallyChanged QBM_YParameterList8  BEGIN TRY9    IF EXISTS(10      SELECT TOP 1 111      FROM inserted)12    GOTO start13    IF EXISTS(14      SELECT TOP 1 115      FROM deleted)16    GOTO start17    RETURN start:18    IF NOT(19      UPDATE(PFDInheritOverwrite) OR20    UPDATE(PTDInheritOverwrite) OR21    UPDATE(PSIInheritOverwrite) OR22    UPDATE(PMDInheritOverwrite) OR23    UPDATE(ADAInheritOverwrite))24    BEGIN25      GOTO EndLabel26    END27    INSERT INTO @ReallyChanged(Parameter1)28    SELECT ovr.ObjectKeyGroup29    FROM TSBSpecificGroupBehavior ovr30    JOIN deleted i31      ON ovr.UID_TSBSpecificGroupBehavior = i.UID_TSBSpecificGroupBehavior32    WHERE33      isnull(ovr.PFDInheritOverwrite,34    0) <> isnull(i.PFDInheritOverwrite,35    0) OR isnull(ovr.PTDInheritOverwrite,36    0) <> isnull(i.PTDInheritOverwrite,37    0) OR isnull(ovr.PSIInheritOverwrite,38    0) <> isnull(i.PSIInheritOverwrite,39    0) OR isnull(ovr.PMDInheritOverwrite,40    0) <> isnull(i.PMDInheritOverwrite,41    0) OR isnull(ovr.ADAInheritOverwrite,42    0) <> isnull(i.ADAInheritOverwrite,43    0)44    IF @@ROWCOUNT = 045    BEGIN46      GOTO EndLabel47    END48    DECLARE @GUIDLDAPGroup QBM_YSingleGUID49    INSERT INTO @GUIDLDAPGroup(UID_SingleGuid)50    SELECT g.UID_LDAPGroup51    FROM LDAPGroup g52    JOIN @ReallyChanged ch53      ON g.XObjectKey = ch.Parameter154    IF @@ROWCOUNT > 055    BEGIN56      DECLARE @DBQueueElements_LDAPAccountInLDAPGroup QBM_YDBQueueRaw57      INSERT INTO @DBQueueElements_LDAPAccountInLDAPGroup(object,58      subobject,59      genprocid)60      SELECT61        x.uid,62        NULL,63        @GenProcID64      FROM(65      SELECT uig.UID_LDAPAccount AS uid66      FROM LDAPAccountInLDAPGroup uig67      JOIN @GUIDLDAPGroup gg68        ON uig.UID_LDAPGroup = gg.UID_SingleGuid) AS x69      EXEC QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup',70        @DBQueueElements_LDAPAccountInLDAPGroup71    END72  END TRY73  BEGIN CATCH74    EXEC QBM_PSessionErrorAdd DEFAULT75    RAISERROR('',76    18,77    1)78      WITH NOWAIT79  END CATCH80  EndLabel:81  RETURN82END
Open raw exported source
SQL ยท Raw14 lines
1create   trigger LDP_TUTSBSpecificGroupBehavior on TSBSpecificGroupBehavior  for update not for Replication as begin declare @GenProcID varchar(382) = dbo.QBM_FGISessionContext('') declare @ReallyChanged QBM_YParameterList  BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select3 top 1 1 from deleted) goto start return start: if not (update( PFDInheritOverwrite ) or update( PTDInheritOverwrite ) or update( PSIInheritOverwrite )4 or update( PMDInheritOverwrite ) or update( ADAInheritOverwrite ) ) begin goto EndLabel end insert into @ReallyChanged(Parameter1) select ovr.ObjectKeyGroup5 from TSBSpecificGroupBehavior ovr join deleted i on ovr.UID_TSBSpecificGroupBehavior = i.UID_TSBSpecificGroupBehavior where isnull(ovr.PFDInheritOverwrite6,0) <> isnull(i.PFDInheritOverwrite, 0) or isnull(ovr.PTDInheritOverwrite,0) <> isnull(i.PTDInheritOverwrite, 0) or isnull(ovr.PSIInheritOverwrite,0) <>7 isnull(i.PSIInheritOverwrite, 0) or isnull(ovr.PMDInheritOverwrite,0) <> isnull(i.PMDInheritOverwrite, 0) or isnull(ovr.ADAInheritOverwrite,0) <> isnull8(i.ADAInheritOverwrite, 0) if @@ROWCOUNT = 0 begin goto EndLabel end declare @GUIDLDAPGroup QBM_YSingleGUID insert into @GUIDLDAPGroup(UID_SingleGuid) 9select g.UID_LDAPGroup from LDAPGroup g join @ReallyChanged ch on g.XObjectKey = ch.Parameter1 if @@ROWCOUNT > 0 begin declare @DBQueueElements_LDAPAccountInLDAPGroup10 QBM_YDBQueueRaw insert into @DBQueueElements_LDAPAccountInLDAPGroup (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select uig.UID_LDAPAccount11 as uid from LDAPAccountInLDAPGroup uig join @GUIDLDAPGroup gg on uig.UID_LDAPGroup = gg.UID_SingleGuid ) as x exec QBM_PDBQueueInsert_Bulk 'LDP-K-LDAPAccountInLDAPGroup'12, @DBQueueElements_LDAPAccountInLDAPGroup end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH EndLabel:13 return end 14