dbo.ATT_TIDialogTable
Database TriggerSQL_TRIGGERSandbox DB
Interpretation
- Database trigger. Treat parent table and enqueue/object-layer calls as the main relation points.
Relations
- Trigger parent table: DialogTable
Typed Edges
- trigger on table DialogTable Trigger parent table: DialogTable
- references source dbo.QBM_FCVElementToObjectKey2 source text reference
- references source dbo.QBM_FCVGUIDToModuleOwner source text reference
- references source dbo.QBM_FGIPrepropConditionDeactiv source text reference
- references source dbo.QBM_FGISessionContext source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
References
- dbo.QBM_FCVElementToObjectKey2
- dbo.QBM_FCVGUIDToModuleOwner
- dbo.QBM_FGIPrepropConditionDeactiv
- dbo.QBM_FGISessionContext
- dbo.QBM_PSessionErrorAdd
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger ATT_TIDialogTable2 ON DialogTable FOR3INSERT NOT FOR Replication4AS5BEGIN6 BEGIN TRY7 IF EXISTS(8 SELECT TOP 1 19 FROM inserted)10 GOTO start11 RETURN start:12 DECLARE @GenProcID varchar(38)13 SELECT @GenProcID = dbo.QBM_FGISessionContext('')14 IF EXISTS(15 SELECT TOP 1 116 FROM inserted i17 WHERE18 dbo.QBM_FCVGUIDToModuleOwner(i.UID_DialogTable) = 'CCC')19 BEGIN20 INSERT INTO ATTBaseObjectHasDecisionRule(UID_PWODecisionRule,21 UID_DialogTable,22 XObjectKey,23 XUserInserted,24 XUserUpdated,25 XDateInserted,26 XDateUpdated)27 SELECT28 x.UID_PWODecisionRule,29 i.UID_DialogTable,30 dbo.QBM_FCVElementToObjectKey2('ATTBaseObjectHasDecisionRule',31 'UID_DialogTable',32 i.UID_DialogTable,33 'UID_PWODecisionRule',34 x.UID_PWODecisionRule),35 i.XUserInserted,36 i.XUserUpdated,37 i.XDateInserted,38 i.XDateUpdated39 FROM inserted i CROSS40 JOIN(41 VALUES('ATT-PWODecisionRule-AS'),42 ('ATT-PWODecisionRule-CD'),43 ('ATT-PWODecisionRule-EX'),44 ('ATT-PWODecisionRule-OM'),45 ('ATT-PWODecisionRule-OR'),46 ('ATT-PWODecisionRule-WC')) AS x(UID_PWODecisionRule)47 WHERE48 dbo.QBM_FCVGUIDToModuleOwner(i.UID_DialogTable) = 'CCC' AND dbo.QBM_FGIPrepropConditionDeactiv('ATTESTATION') = 0 AND NOT EXISTS(49 SELECT TOP 1 150 FROM ATTBaseObjectHasDecisionRule o51 WHERE52 o.UID_DialogTable = i.UID_DialogTable AND o.UID_PWODecisionRule = x.UID_PWODecisionRule)53 END54 END TRY55 BEGIN CATCH56 EXEC QBM_PSessionErrorAdd DEFAULT57 RAISERROR('',58 18,59 1)60 WITH NOWAIT61 END CATCH62END
Open raw exported source
1 create trigger ATT_TIDialogTable on DialogTable for Insert not for Replication as begin BEGIN TRY if exists (select top 1 1 from inserted) goto2 start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if exists (select top 1 1 from inserted i where 3dbo.QBM_FCVGUIDToModuleOwner(i.UID_DialogTable) = 'CCC' ) begin insert into ATTBaseObjectHasDecisionRule (UID_PWODecisionRule, UID_DialogTable, XObjectKey4 , XUserInserted, XUserUpdated, XDateInserted, XDateUpdated) select x.UID_PWODecisionRule, i.UID_DialogTable , dbo.QBM_FCVElementToObjectKey2('ATTBaseObjectHasDecisionRule'5, 'UID_DialogTable', i.UID_DialogTable, 'UID_PWODecisionRule', x.UID_PWODecisionRule) , i.XUserInserted, i.XUserUpdated, i.XDateInserted, i.XDateUpdated6 from inserted i cross join (values ( 'ATT-PWODecisionRule-AS') , ('ATT-PWODecisionRule-CD') , ('ATT-PWODecisionRule-EX') , ('ATT-PWODecisionRule-OM') 7, ('ATT-PWODecisionRule-OR') , ('ATT-PWODecisionRule-WC') ) as x (UID_PWODecisionRule) where dbo.QBM_FCVGUIDToModuleOwner(i.UID_DialogTable) = 'CCC' and8 dbo.QBM_FGIPrepropConditionDeactiv('ATTESTATION') = 0 and not exists (select top 1 1 from ATTBaseObjectHasDecisionRule o where o.UID_DialogTable = i.UID_DialogTable9 and o.UID_PWODecisionRule = x.UID_PWODecisionRule ) end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH10 end 11