dbo.RMS_TIPersonHasESet
Database TriggerSQL_TRIGGERSandbox DB
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 -> RMS-K-PersonHasESet / RMS_ZPersonHasESet at line 8
- Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 8
- Bulk DBQueue insert -> at line 8
- Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 10
- Bulk DBQueue insert -> at line 10
- Bulk DBQueue insert -> at line 17
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: PersonHasESet
Typed Edges
- queues DBQueue task RMS_ZPersonHasESet at line 8 Bulk DBQueue insert -> RMS-K-PersonHasESet / RMS_ZPersonHasESet at line 8
- queues DBQueue task RMS_ZPersonHasObject at line 8 Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 8
- queues DBQueue task at line 8 Bulk DBQueue insert -> at line 8
- queues DBQueue task RMS_ZPersonHasObject at line 10 Bulk DBQueue insert -> RMS-K-PersonHasObject / RMS_ZPersonHasObject at line 10
- queues DBQueue task at line 10 Bulk DBQueue insert -> at line 10
- queues DBQueue task at line 17 Bulk DBQueue insert -> at line 17
- trigger on table PersonHasESet Trigger parent table: PersonHasESet
- 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
- dbo.QBM_FGIBitPatternXOrigin
- dbo.QBM_FGISessionContext
- dbo.QER_FGIITShopFlagCombineValid
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger RMS_TIPersonHasESet2 ON PersonHasESet FOR3INSERT NOT FOR Replication4AS5BEGIN6 DECLARE @EsetOperation varchar(38)7 DECLARE @EsetTable varchar(30)8 DECLARE @ElementBuffer QBM_YCursorBuffer9 DECLARE @ElementCount int10 DECLARE @ElementIndex int11 DECLARE @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin('|Direct|',12 0)13 DECLARE @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|',14 1)15 DECLARE @DBQueueElements_spezial QBM_YDBQueueRaw16 BEGIN TRY17 IF EXISTS(18 SELECT TOP 1 119 FROM inserted)20 GOTO start21 RETURN start:22 DECLARE @GenProcID varchar(38)23 SELECT @GenProcID = dbo.QBM_FGISessionContext('')24 IF EXISTS(25 SELECT TOP 1 126 FROM inserted i27 JOIN ESet elem28 ON i.uid_ESet = elem.uid_ESet29 WHERE30 dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, NULL, NULL, elem.XObjectKey, elem.IsForITShop, elem.IsITShopOnly) = 0 AND i.XOrigin & @QBM_BitPatternXOrigin_Direct31 > 0)32 BEGIN33 RAISERROR('#LDS#Assignment is not permitted due to the combination of IT Shop flags.|',34 18,35 2)36 WITH nowait37 END38 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw39 INSERT INTO @DBQueueElements_01(object,40 subobject,41 genprocid)42 SELECT43 x.uid,44 NULL,45 @GenProcID46 FROM(47 SELECT48 DISTINCT i.UID_Person AS uid49 FROM inserted i50 WHERE51 i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0) AS x52 EXEC QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasESet',53 @DBQueueElements_0154 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw55 INSERT INTO @DBQueueElements_02(object,56 subobject,57 genprocid)58 SELECT59 x.uid,60 NULL,61 @GenProcID62 FROM(63 SELECT64 DISTINCT uid_person AS uid65 FROM inserted i) AS x66 EXEC QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasObject',67 @DBQueueElements_0268 INSERT INTO @ElementBuffer(UID1,69 Ident1)70 SELECT71 DISTINCT v.UID_TaskPerson,72 t.TableName73 FROM inserted i74 JOIN ESetHasEntitlement ehe75 ON i.uid_ESet = ehe.uid_ESet76 JOIN DialogTable t77 ON ehe.Entitlement LIKE '<Key><T>' + t.TableName + '</T>%' AND t.TableName <> 'ESet'78 JOIN BaseTreeAssign v79 ON t.UID_DialogTable = v.UID_DialogTableElement80 WHERE81 v.UID_TaskPerson > ' ' AND i.XIsInEffect = 182 SELECT @ElementCount = @@rowcount83 SELECT @ElementIndex = 184 WHILE @ElementIndex <= @ElementCount85 BEGIN86 SELECT87 TOP 1 @EsetOperation = bu.UID1,88 @EsetTable = bu.Ident189 FROM @ElementBuffer bu90 WHERE91 bu.ElementIndex = @ElementIndex92 DELETE @DBQueueElements_spezial93 INSERT INTO @DBQueueElements_spezial(object,94 subobject,95 genprocid)96 SELECT97 x.uid,98 NULL,99 @GenProcID100 FROM(101 SELECT102 DISTINCT i.uid_Person AS uid103 FROM inserted i104 JOIN ESetHasEntitlement ehe105 ON i.uid_ESet = ehe.uid_ESet AND ehe.XOrigin > 0106 WHERE107 ehe.Entitlement LIKE '<Key><T>' + @EsetTable + '</T>%') AS x108 EXEC QBM_PDBQueueInsert_Bulk @EsetOperation,109 @DBQueueElements_spezial110 SELECT @ElementIndex += 1111 END112 END TRY113 BEGIN CATCH114 EXEC QBM_PSessionErrorAdd DEFAULT115 RAISERROR('',116 18,117 1)118 WITH NOWAIT119 END CATCH120 ende:121 RETURN122END
Open raw exported source
1 create trigger RMS_TIPersonHasESet on PersonHasESet for Insert not for Replication as begin declare @EsetOperation varchar(38) declare @EsetTable2 varchar(30) declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @QBM_BitPatternXOrigin_Direct int = dbo.QBM_FGIBitPatternXOrigin3('|Direct|', 0) declare @QBM_BitPatternXOrigin_Inherit_inv int = dbo.QBM_FGIBitPatternXOrigin('|Inherit|', 1) declare @DBQueueElements_spezial QBM_YDBQueueRaw4 BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext5('') if exists (select top 1 1 from inserted i join ESet elem on i.uid_ESet = elem.uid_ESet where dbo.QER_FGIITShopFlagCombineValid(i.XObjectKey, null6, null, 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.|'7, 18, 2) with nowait end declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid) select x.uid, null,8 @GenProcID from ( select distinct i.UID_Person as uid from inserted i where i.XOrigin & @QBM_BitPatternXOrigin_Inherit_inv > 0 ) as x exec QBM_PDBQueueInsert_Bulk9 'RMS-K-PersonHasESet', @DBQueueElements_01 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) 10select x.uid, null, @GenProcID from ( select distinct uid_person as uid from inserted i ) as x exec QBM_PDBQueueInsert_Bulk 'RMS-K-PersonHasObject', @DBQueueElements_0211 insert into @ElementBuffer(UID1, Ident1) select distinct v.UID_TaskPerson, t.TableName from inserted i join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet12 join DialogTable t on ehe.Entitlement like '<Key><T>' + t.TableName + '</T>%' and t.TableName <> 'ESet' join BaseTreeAssign v on t.UID_DialogTable = 13v.UID_DialogTableElement where v.UID_TaskPerson > ' ' and i.XIsInEffect = 1 select @ElementCount = @@rowcount select @ElementIndex = 1 while @ElementIndex14 <= @ElementCount begin select top 1 @EsetOperation = bu.UID1 , @EsetTable = bu.Ident1 from @ElementBuffer bu where bu.ElementIndex = @ElementIndex delete15 @DBQueueElements_spezial insert into @DBQueueElements_spezial (object, subobject, genprocid) select x.uid, null, @GenProcID from ( select distinct i.uid_Person16 as uid from inserted i join ESetHasEntitlement ehe on i.uid_ESet = ehe.uid_ESet and ehe.XOrigin > 0 where ehe.Entitlement like '<Key><T>' + @EsetTable17 + '</T>%' ) as x exec QBM_PDBQueueInsert_Bulk @EsetOperation, @DBQueueElements_spezial select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd18 default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 19