Back to OIM Explorer

dbo.QBM_TUAssembly_DialogTable

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on DialogTable. Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8; Bulk DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8; Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8; Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8

Source: sandbox-db sys.sql_modules

Source size: 6.068 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-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8
  • Bulk DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8
  • Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 8
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 8
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 8
  • Bulk DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 11
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 11
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 11
  • Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 11
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 11
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 11
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 11
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 13
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 13
  • Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 13
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 13
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 13
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 13
  • Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 14
  • Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 14
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 14
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 14
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 14
  • Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 23
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 23
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 23
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 23
  • Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 36
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 36
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 36
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 37
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 37
  • Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 38
  • References QBM_PDBQueueInsert_Single
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: DialogTable

Typed Edges

  • queues DBQueue task QBM_ZScriptAssemblyReset at line 8 Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 8
  • queues DBQueue task QBM_ZViewBuildAll at line 8 Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 8
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 8 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 8
  • queues DBQueue task QBM_ZRecalculate at line 8 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 8
  • queues DBQueue task QBM_ZScriptAssemblyReset at line 11 Bulk DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 11
  • queues DBQueue task QBM_ZViewBuildAll at line 11 Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 11
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 11 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 11
  • queues DBQueue task QBM_ZRecalculate at line 11 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 11
  • queues DBQueue task QBM_ZScriptAssemblyReset at line 13 Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 13
  • queues DBQueue task QBM_ZViewBuildAll at line 13 Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 13
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 13 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 13
  • queues DBQueue task QBM_ZRecalculate at line 13 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 13
  • queues DBQueue task QBM_ZScriptAssemblyReset at line 14 Single DBQueue insert -> QBM-K-ScriptAssemblyReset / QBM_ZScriptAssemblyReset at line 14
  • queues DBQueue task QBM_ZViewBuildAll at line 14 Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 14
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 14 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 14
  • queues DBQueue task QBM_ZRecalculate at line 14 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 14
  • queues DBQueue task QBM_ZViewBuildAll at line 23 Bulk DBQueue insert -> QBM-K-CommonRebuildView / QBM_ZViewBuildAll at line 23
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 23 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 23
  • queues DBQueue task QBM_ZRecalculate at line 23 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 23
  • queues DBQueue task QBM_ZTriggerWatchCreate at line 36 Bulk DBQueue insert -> QBM-K-CommonMakeWatchtrigger / QBM_ZTriggerWatchCreate at line 36
  • queues DBQueue task QBM_ZRecalculate at line 36 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 36
  • queues DBQueue task QBM_ZRecalculate at line 37 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 37
  • queues DBQueue task QBM_ZRecalculate at line 38 Single DBQueue insert -> QBM-K-CommonReCalculate / QBM_ZRecalculate at line 38
  • trigger on table DialogTable Trigger parent table: DialogTable
  • references source dbo.QBM_FGISessionContext source text reference
  • references source dbo.QBM_FGITableName 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

SQL230 lines
1CREATE trigger QBM_TUAssembly_DialogTable2  ON DialogTable 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(InsertValues) OR19    UPDATE(IsDeactivatedByPreProcessor) OR20    UPDATE(OnDiscardedScript) OR21    UPDATE(OnDiscardingScript) OR22    UPDATE(OnLoadedScript) OR23    UPDATE(OnSavedScript) OR24    UPDATE(OnSavingScript) OR25    UPDATE(SelectScript) OR26    UPDATE(DeleteDelayScript)27    BEGIN28      IF EXISTS(29        SELECT TOP 1 130        FROM deleted d31        JOIN DialogTable t32          ON d.UID_DialogTable = t.UID_DialogTable33        WHERE34          (d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor OR isnull(d.OnDiscardedScript, '') <> isnull(t.OnDiscardedScript,35      '') OR isnull(d.OnDiscardingScript, '') <> isnull(t.OnDiscardingScript, '') OR isnull(d.OnLoadedScript,36      '') <> isnull(t.OnLoadedScript, '') OR isnull(d.OnSavedScript, '') <> isnull(t.OnSavedScript, '') OR isnull(d.OnSavingScript,37      '') <> isnull(t.OnSavingScript, '') OR isnull(d.SelectScript, '') <> isnull(t.SelectScript, '') OR isnull(d.DeleteDelayScript,38      '') <> isnull(t.DeleteDelayScript, '')))39      BEGIN40        EXEC QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset',41        'Table',42        '#',43          @GenProcID44      END45    END46    IF47    UPDATE(IsDeactivatedByPreProcessor)48    BEGIN49      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw50      INSERT INTO @DBQueueElements_01(Object,51      SubObject,52      GenProcID)53      SELECT54        DISTINCT 'JobGen',55        t.TableName,56        @GenProcID57      FROM deleted d58      JOIN DialogTable t59        ON d.UID_DialogTable = t.UID_DialogTable60      WHERE61        (d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor)62      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-ScriptAssemblyReset',63        @DBQueueElements_0164    END65    IF66    UPDATE(IsDeactivatedByPreProcessor)67    BEGIN68      IF EXISTS(69        SELECT TOP 1 170        FROM deleted d71        JOIN DialogTable t72          ON d.UID_DialogTable = t.UID_DialogTable73        WHERE74          (d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor))75      BEGIN76        EXEC QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset',77        'Scripts',78        '#',79          @GenProcID80      END81    END82    IF83    UPDATE(tablename) OR84    UPDATE(IsDeactivatedByPreProcessor)85    BEGIN86      EXEC QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset',87      'TypedWrappers',88      '#',89        @GenProcID90    END91    IF92    UPDATE(TableName) OR93    UPDATE(UID_DialogTableBase) OR94    UPDATE(viewwhereclause) OR95    UPDATE(UID_DialogTableUnion) OR96    UPDATE(UID_DialogTableBase) OR97    UPDATE(IsDeactivatedByPreProcessor) OR98    UPDATE(ExtensionForProxyTable)99    BEGIN100      DECLARE @DBQueueElements_02 QBM_YDBQueueRaw101      INSERT INTO @DBQueueElements_02(object,102      subobject,103      genprocid)104      SELECT105        x.uid,106        NULL,107        @GenProcID108      FROM(109      SELECT i.UID_DialogTable AS UID110      FROM inserted i111      UNION112      SELECT i.UID_DialogTableBase113      FROM inserted i114      WHERE115        i.UID_DialogTableBase > ' '116      UNION117      SELECT i.UID_DialogTableUnion118      FROM inserted i119      WHERE120        i.UID_DialogTableUnion > ' '121      UNION122      SELECT d.UID_DialogTable AS UID123      FROM deleted d124      UNION125      SELECT d.UID_DialogTableBase126      FROM deleted d127      WHERE128        d.UID_DialogTableBase > ' '129      UNION130      SELECT d.UID_DialogTableUnion131      FROM deleted d132      WHERE133        d.UID_DialogTableUnion > ' '134      UNION135      SELECT t.UID_DialogTable136      FROM DialogTable t137      JOIN deleted d138        ON t.UID_DialogTable = d.UID_DialogTable139      WHERE140        ISNULL(t.ExtensionForProxyTable, '') <> isnull(d.ExtensionForProxyTable, '')141      UNION142      SELECT t.UID_DialogTable143      FROM DialogTable t144      JOIN inserted i145        ON t.UID_DialogTableBase = i.UID_DialogTable146      UNION147      SELECT t.UID_DialogTable148      FROM DialogTable t149      JOIN deleted i150        ON t.UID_DialogTableBase = i.UID_DialogTable) AS x151      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonRebuildView',152        @DBQueueElements_02153    END154    IF155    UPDATE(UID_DialogTableBase) OR156    UPDATE(isdeactivatedbypreprocessor) OR157    UPDATE(DisplayPattern) OR158    UPDATE(IsTransportDisabled) OR159    UPDATE(isResident) OR160    UPDATE(isAssignmentWithEvent) OR161    UPDATE(PendingChangeBehavior)162    BEGIN163      DECLARE @DBQueueElements_03 QBM_YDBQueueRaw164      INSERT INTO @DBQueueElements_03(object,165      subobject,166      genprocid)167      SELECT168        dbo.QBM_FGITableName(x.uid),169        NULL,170        @GenProcID171      FROM(172      SELECT i.UID_DialogTable AS UID173      FROM DialogTable i174      JOIN deleted d175        ON i.UID_DialogTable = d.UID_DialogTable176      WHERE177        isnull(i.UID_DialogTableBase, '') <> isnull(d.UID_DialogTableBase, '') OR isnull(i.isdeactivatedbypreprocessor,178      0) <> isnull(d.isdeactivatedbypreprocessor, 0) OR isnull(i.DisplayPattern, N '') <> isnull(d.DisplayPattern,179      N '') OR isnull(i.IsTransportDisabled, 0) <> isnull(d.IsTransportDisabled, 0) OR isnull(i.isResident,180      0) <> isnull(d.isResident, 0) OR isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent,181      0) OR isnull(i.PendingChangeBehavior, 0) <> isnull(d.PendingChangeBehavior, 0)182      UNION183      SELECT i.UID_DialogTableBase AS UID184      FROM DialogTable i185      JOIN deleted d186        ON i.UID_DialogTable = d.UID_DialogTable187      WHERE188        (isnull(i.UID_DialogTableBase, '') <> isnull(d.UID_DialogTableBase, '') OR isnull(i.isResident, 0) <> isnull(d.isResident,189      0) OR isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent, 0) OR isnull(i.PendingChangeBehavior,190      0) <> isnull(d.PendingChangeBehavior, 0)) AND i.UID_DialogTableBase > ' '191      UNION192      SELECT d.UID_DialogTableBase AS UID193      FROM DialogTable i194      JOIN deleted d195        ON i.UID_DialogTable = d.UID_DialogTable196      WHERE197        (isnull(i.UID_DialogTableBase, '') <> isnull(d.UID_DialogTableBase, '') OR isnull(i.isResident, 0) <> isnull(d.isResident,198      0) OR isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent, 0) OR isnull(i.PendingChangeBehavior,199      0) <> isnull(d.PendingChangeBehavior, 0)) AND d.UID_DialogTableBase > ' '200      UNION201      SELECT t.UID_DialogTable202      FROM dialogtable t203      JOIN deleted c204        ON c.UID_DialogTable = t.UID_DialogTableUnion205      JOIN dialogTable t2206        ON c.UID_DialogTable = t2.UID_DialogTable) AS x207      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonMakeWatchtrigger',208        @DBQueueElements_03209    END210    IF211    UPDATE(viewwhereclause)212    BEGIN213      EXEC QBM_PDBQueueInsert_Single 'QBM-K-CommonReCalculate',214      'QBM-K-CommonRebuildViewR',215      '',216        @GenProcID217      EXEC QBM_PDBQueueInsert_Single 'QBM-K-CommonReCalculate',218      'QBM-K-CommonRebuildViewU',219      '',220        @GenProcID221    END222  END TRY223  BEGIN CATCH224    EXEC QBM_PSessionErrorAdd DEFAULT225    RAISERROR('',226    18,227    1)228      WITH NOWAIT229  END CATCH230END
Open raw exported source
SQL ยท Raw40 lines
1  create   trigger QBM_TUAssembly_DialogTable on DialogTable  for Update not for Replication as begin declare @GenProcID varchar(38) = dbo.QBM_FGISessionContext2('') BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start return start: if update(InsertValues3) or update(IsDeactivatedByPreProcessor) or update(OnDiscardedScript) or update(OnDiscardingScript) or update(OnLoadedScript)  or update(OnSavedScript)4 or update(OnSavingScript) or update(SelectScript) or update(DeleteDelayScript) begin if exists (select top 1 1 from deleted d join DialogTable t on d.UID_DialogTable5 = t.UID_DialogTable where ( d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor or isnull(d.OnDiscardedScript, '') <> isnull(t.OnDiscardedScript6, '') or isnull(d.OnDiscardingScript, '') <> isnull(t.OnDiscardingScript, '') or isnull(d.OnLoadedScript, '') <> isnull(t.OnLoadedScript, '')  or isnull7(d.OnSavedScript, '') <> isnull(t.OnSavedScript, '') or isnull(d.OnSavingScript, '') <> isnull(t.OnSavingScript, '') or isnull(d.SelectScript, '') <> isnull8(t.SelectScript, '') or isnull(d.DeleteDelayScript, '') <> isnull(t.DeleteDelayScript, '') ) ) begin exec QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset'9, 'Table', '#', @GenProcID  end end if update(IsDeactivatedByPreProcessor) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_0110(Object, SubObject, GenProcID) select distinct 'JobGen', t.TableName , @GenProcID from deleted d join DialogTable t on d.UID_DialogTable = t.UID_DialogTable11 where ( d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor ) exec QBM_PDBQueueInsert_Bulk 'QBM-K-ScriptAssemblyReset', @DBQueueElements_0112 end  if update(IsDeactivatedByPreProcessor) begin if exists (select top 1 1 from deleted d join DialogTable t on d.UID_DialogTable = t.UID_DialogTable13 where ( d.IsDeactivatedByPreProcessor <> t.IsDeactivatedByPreProcessor ) ) begin exec QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset', 'Scripts'14, '#', @GenProcID  end end if update(tablename) or update(IsDeactivatedByPreProcessor) begin exec QBM_PDBQueueInsert_Single 'QBM-K-ScriptAssemblyReset'15, 'TypedWrappers', '#', @GenProcID end  if update(TableName) or update(UID_DialogTableBase) or update(viewwhereclause) or update(UID_DialogTableUnion) 16or update(UID_DialogTableBase) or update(IsDeactivatedByPreProcessor) or update(ExtensionForProxyTable) begin  declare @DBQueueElements_02 QBM_YDBQueueRaw17 insert into @DBQueueElements_02 (object, subobject, genprocid) select x.uid, null, @GenProcID from (select i.UID_DialogTable as UID from inserted i union18 select i.UID_DialogTableBase from inserted i where i.UID_DialogTableBase > ' ' union select i.UID_DialogTableUnion from inserted i where i.UID_DialogTableUnion19 > ' ' union select d.UID_DialogTable as UID from deleted d union select d.UID_DialogTableBase from deleted d where d.UID_DialogTableBase > ' ' union select20 d.UID_DialogTableUnion from deleted d where d.UID_DialogTableUnion > ' ' union select t.UID_DialogTable from DialogTable t join deleted d on t.UID_DialogTable21 = d.UID_DialogTable where ISNULL(t.ExtensionForProxyTable, '') <> isnull(d.ExtensionForProxyTable, '') union select t.UID_DialogTable from DialogTable22 t join inserted i on t.UID_DialogTableBase = i.UID_DialogTable union select t.UID_DialogTable from DialogTable t join deleted i on t.UID_DialogTableBase23 = i.UID_DialogTable ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonRebuildView', @DBQueueElements_02 end  if update(UID_DialogTableBase) or update(isdeactivatedbypreprocessor24) or update(DisplayPattern) or update(IsTransportDisabled) or update(isResident) or update(isAssignmentWithEvent) or update(PendingChangeBehavior) begin25 declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid) select dbo.QBM_FGITableName(x.uid), null, @GenProcID26 from (select i.UID_DialogTable as UID from DialogTable i join deleted d on i.UID_DialogTable = d.UID_DialogTable where isnull(i.UID_DialogTableBase,''27) <> isnull(d.UID_DialogTableBase,'') or isnull(i.isdeactivatedbypreprocessor,0) <> isnull(d.isdeactivatedbypreprocessor,0) or isnull(i.DisplayPattern,28N'') <> isnull(d.DisplayPattern,N'') or isnull(i.IsTransportDisabled,0) <> isnull(d.IsTransportDisabled,0) or isnull(i.isResident, 0) <> isnull(d.isResident29, 0) or isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent, 0) or isnull(i.PendingChangeBehavior, 0) <> isnull(d.PendingChangeBehavior30, 0) union select i.UID_DialogTableBase as UID from DialogTable i join deleted d on i.UID_DialogTable = d.UID_DialogTable where ( isnull(i.UID_DialogTableBase31,'') <> isnull(d.UID_DialogTableBase,'') or isnull(i.isResident, 0) <> isnull(d.isResident, 0) or isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent32, 0) or isnull(i.PendingChangeBehavior, 0) <> isnull(d.PendingChangeBehavior, 0) ) and i.UID_DialogTableBase > ' ' union select d.UID_DialogTableBase as33 UID from DialogTable i join deleted d on i.UID_DialogTable = d.UID_DialogTable where ( isnull(i.UID_DialogTableBase,'') <> isnull(d.UID_DialogTableBase34,'') or isnull(i.isResident, 0) <> isnull(d.isResident, 0) or isnull(i.isAssignmentWithEvent, 0) <> isnull(d.isAssignmentWithEvent, 0) or isnull(i.PendingChangeBehavior35, 0) <> isnull(d.PendingChangeBehavior, 0) ) and d.UID_DialogTableBase > ' ' union  select t.UID_DialogTable from dialogtable t join deleted c on c.UID_DialogTable36 = t.UID_DialogTableUnion join dialogTable t2 on c.UID_DialogTable = t2.UID_DialogTable   ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonMakeWatchtrigger'37, @DBQueueElements_03 end if update(viewwhereclause) begin exec QBM_PDBQueueInsert_Single 'QBM-K-CommonReCalculate', 'QBM-K-CommonRebuildViewR', '', @GenProcID38 exec QBM_PDBQueueInsert_Single 'QBM-K-CommonReCalculate', 'QBM-K-CommonRebuildViewU', '', @GenProcID end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd39 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH end 40