Back to OIM Explorer

dbo.TSB_TIBaseTreeHasUNSGroupB

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on BaseTreeHasUNSGroupB. Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 9; Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 9; Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 9; Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 9

Source: sandbox-db sys.sql_modules

Source size: 2.892 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 -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 9
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 9
  • Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 9
  • Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 9
  • Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 12
  • Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 12
  • Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 12
  • Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 16
  • Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 16
  • Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 18
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: BaseTreeHasUNSGroupB

Typed Edges

  • queues DBQueue task QER_ZAllChildrenOfOrg at line 9 Bulk DBQueue insert -> QER-K-AllChildrenOfOrg / QER_ZAllChildrenOfOrg at line 9
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 9 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 9
  • queues DBQueue task TSB_ZUNSAccountBInUNSGroupB at line 9 Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 9
  • queues DBQueue task TSB_ZBaseTreeHasObject at line 9 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 9
  • queues DBQueue task QER_ZITShopProductNodeCheck at line 12 Bulk DBQueue insert -> QER-K-OrgAutoChild / QER_ZITShopProductNodeCheck at line 12
  • queues DBQueue task TSB_ZUNSAccountBInUNSGroupB at line 12 Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 12
  • queues DBQueue task TSB_ZBaseTreeHasObject at line 12 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 12
  • queues DBQueue task TSB_ZUNSAccountBInUNSGroupB at line 16 Bulk DBQueue insert -> TSB-K-UNSAccountBInUNSGroupB / TSB_ZUNSAccountBInUNSGroupB at line 16
  • queues DBQueue task TSB_ZBaseTreeHasObject at line 16 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 16
  • queues DBQueue task TSB_ZBaseTreeHasObject at line 18 Bulk DBQueue insert -> TSB-K-BaseTreeHasObject / TSB_ZBaseTreeHasObject at line 18
  • trigger on table BaseTreeHasUNSGroupB Trigger parent table: BaseTreeHasUNSGroupB
  • 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.QER_PAssignmentCheckValid source text reference

Complete Source

SQL133 lines
1CREATE trigger TSB_TIBaseTreeHasUNSGroupB2  ON BaseTreeHasUNSGroupB FOR3INSERT NOT FOR Replication4AS5BEGIN6  DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',7  0)8  DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',9  1)10  BEGIN TRY11    IF EXISTS(12      SELECT TOP 1 113      FROM inserted)14    GOTO start15    RETURN start:16    DECLARE @GenProcID varchar(38)17    SELECT @GenProcID = dbo.QBM_FGISessionContext('')18    DECLARE @AssignCheckValues QBM_YparameterList19    INSERT INTO @AssignCheckValues(Parameter1,20    Parameter2)21    SELECT22      i.UID_Org,23      i.XOrigin24    FROM inserted i25    EXEC QER_PAssignmentCheckValid 'TSB-AsgnBT-UNSGroupB',26      @AssignCheckValues,27      @GenProcID28    IF EXISTS(29      SELECT TOP 1 130      FROM inserted i31      JOIN BaseTree dest32        ON i.uid_Org = dest.uid_Org33      JOIN UNSGroupB elem34        ON i.uid_UNSGroupB = elem.uid_UNSGroupB35      WHERE36        dbo.QER_FGIITShopFlagCombineValid(dest.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop,37    elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0)38    BEGIN39      RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',40      18,41      2)42        WITH nowait43    END44    DECLARE @DBQueueElements_01 QBM_YDBQueueRaw45    INSERT INTO @DBQueueElements_01(object,46    subobject,47    genprocid)48    SELECT49      x.uid,50      'TSB-K-OrgHasUNSGroupB',51      @GenProcID52    FROM(53    SELECT54      DISTINCT d.uid_org AS uid55    FROM inserted d56    WHERE57      d.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x58    EXEC QBM_PDBQueueInsert_Bulk 'QER-K-AllChildrenOfOrg',59      @DBQueueElements_0160    DECLARE @DBQueueElements_02 QBM_YDBQueueRaw61    INSERT INTO @DBQueueElements_02(object,62    subobject,63    genprocid)64    SELECT65      x.uid,66      NULL,67      @GenProcID68    FROM(69    SELECT70      DISTINCT b.uid_org AS uid71    FROM inserted d72    JOIN BaseTree b73      ON d.uid_org = b.uid_org74    WHERE75      b.ITShopInfo = 'BO' AND d.XIsInEffect = 1) AS x76    EXEC QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild',77      @DBQueueElements_0278    DECLARE @DBQueueElements_03 QBM_YDBQueueRaw79    INSERT INTO @DBQueueElements_03(object,80    subobject,81    genprocid)82    SELECT83      x.uid,84      NULL,85      @GenProcID86    FROM(87    SELECT88      DISTINCT UNS.UID_UNSAccountB AS uid89    FROM inserted i90    JOIN(91    SELECT92      pio.uid_person, pio.uid_org93    FROM personinBaseTree pio94    WHERE95      pio.XOrigin > 096    UNION all97    SELECT98      uid_person, uid_org99    FROM helperPersonOrg) hpo100      ON hpo.uid_org = i.uid_org101    JOIN UNSAccountB UNS102      ON UNS.uid_person = hpo.uid_person AND UNS.IsGroupAccount_UNSGroupB = 1103    WHERE104      i.XIsInEffect = 1) AS x105    EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBInUNSGroupB',106      @DBQueueElements_03107    DECLARE @DBQueueElements_04 QBM_YDBQueueRaw108    INSERT INTO @DBQueueElements_04(object,109    subobject,110    genprocid)111    SELECT112      x.uid,113      NULL,114      @GenProcID115    FROM(116    SELECT117      DISTINCT i.uid_org AS uid118    FROM inserted i119    WHERE120      i.XIsInEffect = 1) AS x121    EXEC QBM_PDBQueueInsert_Bulk 'TSB-K-BaseTreeHasObject',122      @DBQueueElements_04123  END TRY124  BEGIN CATCH125    EXEC QBM_PSessionErrorAdd DEFAULT126    RAISERROR('',127    18,128    1)129      WITH NOWAIT130  END CATCH131  ende:132  RETURN133END
Open raw exported source
SQL ยท Raw20 lines
1  create   trigger TSB_TIBaseTreeHasUNSGroupB on BaseTreeHasUNSGroupB  for Insert not for Replication as begin  declare @QBM_BitPatternXOrigin_Direct2 int = dbo.QBM_FGIBitPatternXOrigin('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1)  BEGIN3 TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('')4 declare @AssignCheckValues QBM_YparameterList insert into @AssignCheckValues(Parameter1, Parameter2) select i.UID_Org, i.XOrigin from inserted i exec 5QER_PAssignmentCheckValid 'TSB-AsgnBT-UNSGroupB', @AssignCheckValues, @GenProcID  if exists (select top 1 1 from inserted i join BaseTree dest on i.uid_Org6 = dest.uid_Org  join UNSGroupB elem on i.uid_UNSGroupB = elem.uid_UNSGroupB where dbo.QER_FGIITShopFlagCombineValid(dest.XObjectKey, null, null7, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 and i.XOrigin & @QBM_BitPatternXOrigin_Direct > 0 ) begin  raiserror ('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|'8, 18, 2) with nowait end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, 'TSB-K-OrgHasUNSGroupB'9, @GenProcID from ( select distinct d.uid_org as uid from inserted d  where d.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0  ) as x exec QBM_PDBQueueInsert_Bulk10 'QER-K-AllChildrenOfOrg', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid11) select x.uid, null, @GenProcID from ( select distinct b.uid_org as uid from inserted d join BaseTree b on d.uid_org = b.uid_org where b.ITShopInfo = 12'BO' and d.XIsInEffect = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'QER-K-OrgAutoChild', @DBQueueElements_02 declare @DBQueueElements_03 QBM_YDBQueueRaw insert13 into @DBQueueElements_03 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct UNS.UID_UNSAccountB as uid from inserted14 i join (select pio.uid_person, pio.uid_org from personinBaseTree pio where pio.XOrigin > 0 union all select uid_person, uid_org from helperPersonOrg )15 hpo on hpo.uid_org = i.uid_org join UNSAccountB UNS on UNS.uid_person = hpo.uid_person and UNS.IsGroupAccount_UNSGroupB = 1 where i.XIsInEffect = 116 ) as x exec QBM_PDBQueueInsert_Bulk 'TSB-K-UNSAccountBInUNSGroupB', @DBQueueElements_03  declare @DBQueueElements_04 QBM_YDBQueueRaw insert into @DBQueueElements_0417 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.uid_org as uid from inserted i where i.XIsInEffect = 1 ) as x exec18 QBM_PDBQueueInsert_Bulk 'TSB-K-BaseTreeHasObject', @DBQueueElements_04 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH19 NOWAIT END CATCH ende: return end 20