Back to OIM Explorer

dbo.QER_TUDialogGroup

Database TriggerSQL_TRIGGERSandbox DB

Database Trigger on DialogGroup. Bulk DBQueue insert -> QBM-K-DialogUserInGroup / QBM_ZDialogUserInGroup at line 9; References QBM_PDBQueueInsert_Bulk; Trigger parent table: DialogGroup

Source: sandbox-db sys.sql_modules

Source size: 1.569 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 -> QBM-K-DialogUserInGroup / QBM_ZDialogUserInGroup at line 9
  • References QBM_PDBQueueInsert_Bulk
  • Trigger parent table: DialogGroup

Typed Edges

  • queues DBQueue task QBM_ZDialogUserInGroup at line 9 Bulk DBQueue insert -> QBM-K-DialogUserInGroup / QBM_ZDialogUserInGroup at line 9
  • trigger on table DialogGroup Trigger parent table: DialogGroup
  • 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

SQL78 lines
1CREATE trigger QER_TUDialogGroup2  ON DialogGroup FOR3UPDATE NOT FOR Replication4AS5BEGIN6  BEGIN TRY7    IF EXISTS(8      SELECT TOP 1 19      FROM inserted)10    GOTO start11    IF EXISTS(12      SELECT TOP 1 113      FROM deleted)14    GOTO start15    RETURN start:16    DECLARE @GenProcID varchar(38)17    SELECT @GenProcID = dbo.QBM_FGISessionContext('')18    IF19    UPDATE(IsRoleBasedOnly)20    BEGIN21      IF EXISTS(22        SELECT TOP 1 123        FROM inserted i24        JOIN BaseTree b25          ON i.UID_DialogGroup = b.UID_DialogGroup26        WHERE27          i.IsRoleBasedOnly = 0)28      BEGIN29        RAISERROR('#LDS#Cannot change DialogGroup.IsRoleBasedOnly because it''s assigned to BaseTree.|',30        18,31        2)32          WITH nowait33      END34      IF EXISTS(35        SELECT TOP 1 136        FROM deleted d37        JOIN DialogGroup i38          ON d.UID_DialogGroup = i.UID_DialogGroup39        WHERE40          d.IsRoleBasedOnly = 1 AND i.IsRoleBasedOnly = 0)41      BEGIN42        RAISERROR('#LDS#Cannot change DialogGroup.IsRoleBasedOnly from true to false. Create a new group instead.|',43        18,44        2)45          WITH nowait46      END47      DECLARE @DBQueueElements_01 QBM_YDBQueueRaw48      INSERT INTO @DBQueueElements_01(object,49      subobject,50      genprocid)51      SELECT52        x.uid,53        NULL,54        @GenProcID55      FROM(56      SELECT57        DISTINCT u.UID_DialogUser AS uid58      FROM deleted d59      JOIN DialogGroup i60        ON d.UID_DialogGroup = i.UID_DialogGroup61      JOIN DialogUserInGroup uig62        ON uig.UID_DialogGroup = i.UID_DialogGroup63      JOIN DialogUser u64        ON uig.UID_DialogUser = u.UID_DialogUser65      WHERE66        d.IsRoleBasedOnly = 0 AND i.IsRoleBasedOnly = 1 AND u.IsAdmin = 1) AS x67      EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-DialogUserInGroup',68        @DBQueueElements_0169    END70  END TRY71  BEGIN CATCH72    EXEC QBM_PSessionErrorAdd DEFAULT73    RAISERROR('',74    18,75    1)76      WITH NOWAIT77  END CATCH78END
Open raw exported source
SQL ยท Raw12 lines
1create   trigger QER_TUDialogGroup on DialogGroup  for Update not for Replication as begin  BEGIN TRY if exists (select top 1 1 from inserted) goto2 start if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext(''3) if update(IsRoleBasedOnly) begin  if exists (select top 1 1 from inserted i join BaseTree b on i.UID_DialogGroup = b.UID_DialogGroup where i.IsRoleBasedOnly4 = 0 ) begin raiserror( '#LDS#Cannot change DialogGroup.IsRoleBasedOnly because it''s assigned to BaseTree.|', 18, 2) with nowait end         if exists5 (select top 1 1 from deleted d join DialogGroup i on d.UID_DialogGroup = i.UID_DialogGroup where d.IsRoleBasedOnly = 1 and i.IsRoleBasedOnly = 0 ) begin6 raiserror( '#LDS#Cannot change DialogGroup.IsRoleBasedOnly from true to false. Create a new group instead.|', 18, 2) with nowait end   declare @DBQueueElements_017 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct u.UID_DialogUser 8as uid from deleted d join DialogGroup i on d.UID_DialogGroup = i.UID_DialogGroup join DialogUserInGroup uig on uig.UID_DialogGroup = i.UID_DialogGroup9 join DialogUser u on uig.UID_DialogUser = u.UID_DialogUser where d.IsRoleBasedOnly = 0 and i.IsRoleBasedOnly = 1 and u.IsAdmin = 1 ) as x exec QBM_PDBQueueInsert_Bulk10 'QBM-K-DialogUserInGroup', @DBQueueElements_01 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH 11end 12