Back to OIM Explorer

dbo.QBM_TUAssembly_DialValDynRef

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on DialogValidDynamicRef. Single DBQueue insert -> QBM-K-CommonMakeRITriggerPre / QBM_ZRITriggerPrepare at line 3; Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 3; Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 3; Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 11

Source: sandbox-db sys.sql_modules

Source size: 1.954 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

  • Single DBQueue insert -> QBM-K-CommonMakeRITriggerPre / QBM_ZRITriggerPrepare at line 3
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 3
  • Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 3
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 11
  • Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 11
  • Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 12
  • References QBM_PDBQueueInsert_Single
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: DialogValidDynamicRef

Typed Edges

  • queues DBQueue task QBM_ZRITriggerPrepare at line 3 Single DBQueue insert -> QBM-K-CommonMakeRITriggerPre / QBM_ZRITriggerPrepare at line 3
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 3 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 3
  • queues DBQueue task QBM_ZRITriggerCreate at line 3 Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 3
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 11 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 11
  • queues DBQueue task QBM_ZRITriggerCreate at line 11 Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 11
  • queues DBQueue task QBM_ZRITriggerCreate at line 12 Bulk DBQueue insert -> QBM-K-CommonMakeRITrigger / QBM_ZRITriggerCreate at line 12
  • trigger on table DialogValidDynamicRef Trigger parent table: DialogValidDynamicRef
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_PDBQueueInsert_Bulk source text reference
  • references source dbo.QBM_PDBQueueInsert_Single source text reference
  • references source dbo.QBM_PSessionErrorAdd source text reference

Complete Source

SQL81 lines
1CREATE trigger QBM_TUAssembly_DialValDynRef2  ON DialogValidDynamicRef FOR3UPDATE NOT FOR Replication4AS5BEGIN6  DECLARE @GenProcID varchar(38) = dbo.QBM_FGISessionContext('')7  BEGIN TRY8    IF EXISTS(9      SELECT TOP 1 110      FROM inserted)11    GOTO start12    IF EXISTS(13      SELECT TOP 1 114      FROM deleted)15    GOTO start16    RETURN start:17    IF18    UPDATE(ParentRestriction) OR19    UPDATE(ParentExecuteBy) OR20    UPDATE(ChildExecuteBy)21    BEGIN22      EXEC QBM_PDBQueueInsert_Single 'QBM-K-CommonMakeRITriggerPre',23      '',24      '',25        @GenProcID26    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 t.TableName AS UID37    FROM DialogValidDynamicRef i38    JOIN deleted d39      ON i.XObjectKey = d.XObjectKey40    JOIN DialogColumn c41      ON i.UID_DialogColumn = c.UID_DialogColumn42    JOIN DialogTable t43      ON c.UID_DialogTable = t.UID_DialogTable44    WHERE45      isnull(i.ChildExecuteBy, '') <> isnull(d.ChildExecuteBy, '') OR isnull(i.ParentExecuteBy, '') <> isnull(d.ParentExecuteBy,46    '') OR isnull(i.ParentRestriction, '') <> isnull(d.ParentRestriction, '')47    UNION48    SELECT t.TableName AS UID49    FROM DialogValidDynamicRef i50    JOIN deleted d51      ON i.XObjectKey = d.XObjectKey52    JOIN DialogTable t53      ON i.UID_DialogTableReference = t.UID_DialogTable54    WHERE55      isnull(i.ChildExecuteBy, '') <> isnull(d.ChildExecuteBy, '') OR isnull(i.ParentExecuteBy, '') <> isnull(d.ParentExecuteBy,56    '') OR isnull(i.ParentRestriction, '') <> isnull(d.ParentRestriction, '')) AS x57    INSERT INTO @DBQueueElements_01(object,58    subobject,59    genprocid)60    SELECT61      b.TableName,62      NULL,63      e.GenProcID64    FROM @DBQueueElements_01 e65    JOIN DialogTable v66      ON e.Object = v.TableName67    JOIN DialogTable b68      ON v.UID_DialogTableBase = b.UID_DialogTable69    EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonMakeWatchtrigger',70      @DBQueueElements_0171    EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonMakeRITrigger',72      @DBQueueElements_0173  END TRY74  BEGIN CATCH75    EXEC QBM_PSessionErrorAdd DEFAULT76    RAISERROR('',77    18,78    1)79      WITH NOWAIT80  END CATCH81END
Open raw exported source
SQL ยท Raw14 lines
1 create   trigger QBM_TUAssembly_DialValDynRef on DialogValidDynamicRef  for Update not for Replication as begin declare @GenProcID varchar(38) 2= dbo.QBM_FGISessionContext('') BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return3 start:  if update(ParentRestriction) or update(ParentExecuteBy)  or update(ChildExecuteBy) begin exec QBM_PDBQueueInsert_Single 'QBM-K-CommonMakeRITriggerPre'4, '', '', @GenProcID end  declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null5, @GenProcID from (select t.TableName as UID from DialogValidDynamicRef i join deleted d on i.XObjectKey = d.XObjectKey join DialogColumn c on i.UID_DialogColumn6 = c.UID_DialogColumn join DialogTable t on c.UID_DialogTable = t.UID_DialogTable where isnull(i.ChildExecuteBy,'') <> isnull(d.ChildExecuteBy,'') or isnull7(i.ParentExecuteBy,'') <> isnull(d.ParentExecuteBy,'')  or isnull(i.ParentRestriction,'') <> isnull(d.ParentRestriction,'') union select t.TableName as8 UID from DialogValidDynamicRef i join deleted d on i.XObjectKey = d.XObjectKey join DialogTable t on i.UID_DialogTableReference = t.UID_DialogTable where9 isnull(i.ChildExecuteBy,'') <> isnull(d.ChildExecuteBy,'') or isnull(i.ParentExecuteBy,'') <> isnull(d.ParentExecuteBy,'')  or isnull(i.ParentRestriction10,'') <> isnull(d.ParentRestriction,'') ) as x  insert into @DBQueueElements_01 (object, subobject, genprocid) select b.TableName, null, e.GenProcID from11 @DBQueueElements_01 e join DialogTable v on e.Object = v.TableName join DialogTable b on v.UID_DialogTableBase = b.UID_DialogTable exec QBM_PDBQueueInsert_Bulk12 'QBM-K-CommonMakeWatchtrigger', @DBQueueElements_01 exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonMakeRITrigger' , @DBQueueElements_01  END TRY BEGIN CATCH13 exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH end 14