dbo.QBM_TUDialogColumn
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 -> QBM-K-CommonPrepropColumn / QBM_ZPrePropColumn at line 14
- Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 14
- Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 14
- Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 14
- Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 14
- Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 17
- Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 17
- Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 17
- Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 17
- Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 24
- Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 24
- Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 24
- Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 33
- Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 33
- Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 35
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: DialogColumn
Typed Edges
- queues DBQueue task QBM_ZPrePropColumn at line 14 Bulk DBQueue insert -> QBM-K-CommonPrepropColumn / QBM_ZPrePropColumn at line 14
- queues DBQueue task QBM_ZPrePropTable at line 14 Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 14
- queues DBQueue task QBM_ZSplittedLookupFill at line 14 Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 14
- queues DBQueue task QBM_ZMissingDisplayRightFill at line 14 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 14
- queues DBQueue task QBM_ZIndexCreateGenerated at line 14 Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 14
- queues DBQueue task QBM_ZPrePropTable at line 17 Bulk DBQueue insert -> QBM-K-CommonPrepropTable / QBM_ZPrePropTable at line 17
- queues DBQueue task QBM_ZSplittedLookupFill at line 17 Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 17
- queues DBQueue task QBM_ZMissingDisplayRightFill at line 17 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 17
- queues DBQueue task QBM_ZIndexCreateGenerated at line 17 Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 17
- queues DBQueue task QBM_ZSplittedLookupFill at line 24 Bulk DBQueue insert -> QBM-K-SplittedLookupFill / QBM_ZSplittedLookupFill at line 24
- queues DBQueue task QBM_ZMissingDisplayRightFill at line 24 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 24
- queues DBQueue task QBM_ZIndexCreateGenerated at line 24 Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 24
- queues DBQueue task QBM_ZMissingDisplayRightFill at line 33 Bulk DBQueue insert -> QBM-K-MissingDisplayRightFill / QBM_ZMissingDisplayRightFill at line 33
- queues DBQueue task QBM_ZIndexCreateGenerated at line 33 Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 33
- queues DBQueue task QBM_ZIndexCreateGenerated at line 35 Bulk DBQueue insert -> QBM-K-IndexCreateGenerated / QBM_ZIndexCreateGenerated at line 35
- trigger on table DialogColumn Trigger parent table: DialogColumn
- 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_PPrePropCheckSyntax source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
Complete Source
1CREATE trigger QBM_TUDialogColumn2 ON DialogColumn FOR3UPDATE NOT FOR Replication4AS5BEGIN6 DECLARE @ConditionsToCheck QBM_YParameterList7 DECLARE @XUser nvarchar(64) = object_name(@@procid)8 DECLARE @Xdate datetime = getutcdate()9 BEGIN TRY10 IF EXISTS(11 SELECT TOP 1 112 FROM inserted)13 GOTO start14 IF EXISTS(15 SELECT TOP 1 116 FROM deleted)17 GOTO start18 RETURN start:19 DECLARE @GenProcID varchar(38)20 SELECT @GenProcID = dbo.QBM_FGISessionContext('')21 IF22 UPDATE(isDynamicFK)23 BEGIN24 IF EXISTS(25 SELECT TOP 1 126 FROM dialogColumn c27 JOIN deleted d28 ON c.uid_DialogColumn = d.uid_dialogcolumn29 JOIN dialogtable t30 ON c.uid_dialogtable = t.uid_dialogtable31 JOIN(32 SELECT33 'WatchOperation' AS TableName, 'ObjectKey' AS Columnname34 UNION all35 SELECT36 'QBMTaggedChange', 'ObjectKey'37 UNION all38 SELECT39 'DialogTaggedItem', 'ObjectKey'40 UNION all41 SELECT42 'DialogWatchOperation', 'ObjectKeyOfRow') AS x43 ON x.TableName = t.TableName AND x.columnname = c.columnname44 WHERE45 c.isDynamicFK = 1)46 BEGIN47 RAISERROR('#LDS#Cannot set property isDynamicFK to true in this column|',48 18,49 2)50 WITH NOWAIT51 END52 END53 IF54 UPDATE(preprocessorcondition)55 BEGIN56 IF EXISTS(57 SELECT TOP 1 158 FROM dialogcolumn c59 JOIN deleted d60 ON c.uid_dialogColumn = d.uid_dialogcolumn AND isnull(c.preprocessorcondition, N '') > ' ' AND isnull(d.preprocessorcondition,61 N '') = N ''62 JOIN DialogTable t63 ON c.UID_DialogTable = t.UID_DialogTable64 JOIN information_schema.columns sc65 ON t.TableName = sc.table_name AND c.columnname = sc.column_name AND sc.IS_NULLABLE = 'No')66 BEGIN67 RAISERROR('#LDS#Preprocessor conditions on columns without null are not allowed.|',68 18,69 1)70 END71 END72 IF73 UPDATE(preprocessorcondition)74 BEGIN75 INSERT INTO @ConditionsToCheck(ContentFull)76 SELECT i.PreProcessorCondition77 FROM inserted i78 EXEC QBM_PPrePropCheckSyntax @ConditionsToCheck79 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw80 INSERT INTO @DBQueueElements_01(object,81 subobject,82 genprocid)83 SELECT84 x.uid,85 NULL,86 @GenProcID87 FROM(88 SELECT i.uid_dialogColumn AS UID89 FROM DialogColumn i90 JOIN deleted d91 ON d.uid_dialogColumn = i.uid_dialogColumn AND isnull(d.PreprocessorCondition, N '') <> isnull(i.PreprocessorCondition,92 N '')) AS x93 EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropColumn',94 @DBQueueElements_0195 DECLARE @DBQueueElements_02 QBM_YDBQueueRaw96 INSERT INTO @DBQueueElements_02(object,97 subobject,98 genprocid)99 SELECT100 dbo.QBM_FGITableName(x.uid),101 NULL,102 @GenProcID103 FROM(104 SELECT105 DISTINCT i.UID_DialogTable AS UID106 FROM DialogColumn i107 JOIN deleted d108 ON d.uid_dialogColumn = i.uid_dialogColumn AND isnull(d.PreprocessorCondition, N '') <> isnull(i.PreprocessorCondition,109 N '') AND isnull(i.ispkmember, 0) = 1) AS x110 EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTable',111 @DBQueueElements_02112 END113 IF114 UPDATE(IsOverwritingTemplate) OR115 UPDATE(Template) OR116 UPDATE(Format) OR117 UPDATE(FormatScript)118 BEGIN119 UPDATE dialogcolumn120 SET IsTemplateChanged = 1,121 XDateUpdated = @Xdate,122 XUserUpdated = @XUser123 WHERE124 uid_dialogcolumn IN(125 SELECT uid_dialogcolumn126 FROM inserted) AND isnull(IsTemplateChanged,127 0) = 0128 END129 IF130 UPDATE(SplittedLookupSupport)131 BEGIN132 DECLARE @DBQueueElements_03 QBM_YDBQueueRaw133 INSERT INTO @DBQueueElements_03(object,134 subobject,135 genprocid)136 SELECT137 x.uid,138 NULL,139 @GenProcID140 FROM(141 SELECT c.UID_DialogColumn AS UID142 FROM deleted d143 JOIN DialogColumn c144 ON d.UID_DialogColumn = c.UID_DialogColumn145 WHERE146 isnull(d.SplittedLookupSupport, '') <> isnull(c.SplittedLookupSupport, '')) AS x147 DELETE QBMSplittedLookup148 FROM QBMSplittedLookup s149 JOIN @DBQueueElements_03 e150 ON s.UID_DialogColumn = e.Object151 DELETE @DBQueueElements_03152 FROM @DBQueueElements_03 e153 JOIN DialogColumn c154 ON c.UID_DialogColumn = e.Object155 WHERE156 isnull(c.SplittedLookupSupport,157 '') = ''158 EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-SplittedLookupFill',159 @DBQueueElements_03160 END161 IF162 UPDATE(IsDeactivatedByPreProcessor) OR163 UPDATE(IsForeignKey) OR164 UPDATE(IsDynamicFK)165 BEGIN166 DECLARE @DBQueueElements_36836 QBM_YDBQueueRaw167 INSERT INTO @DBQueueElements_36836(Object,168 SubObject,169 GenProcID)170 SELECT171 x.uid,172 NULL,173 @GenProcID174 FROM(175 SELECT ra.UID_DialogTableParent AS uid176 FROM deleted d177 JOIN DialogColumn c178 ON d.UID_DialogColumn = c.UID_DialogColumn179 JOIN QBM_VQBMRelationALL ra180 ON c.UID_DialogTable = ra.UID_DialogTableChild181 WHERE182 isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor, 0) OR isnull(d.IsForeignKey,183 '') <> isnull(c.IsForeignKey, '') OR isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '')184 UNION185 SELECT ra.UID_DialogTableChild186 FROM deleted d187 JOIN DialogColumn c188 ON d.UID_DialogColumn = c.UID_DialogColumn189 JOIN QBM_VQBMRelationALL ra190 ON c.UID_DialogTable = ra.UID_DialogTableParent191 WHERE192 isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor, 0) OR isnull(d.IsForeignKey,193 '') <> isnull(c.IsForeignKey, '') OR isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '')194 UNION195 SELECT c.UID_DialogTable196 FROM deleted d197 JOIN DialogColumn c198 ON d.UID_DialogColumn = c.UID_DialogColumn199 WHERE200 isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor, 0) OR isnull(d.IsForeignKey,201 '') <> isnull(c.IsForeignKey, '') OR isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '')) AS x202 EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-MissingDisplayRightFill',203 @DBQueueElements_36836204 DECLARE @DBQueueElements_478459 QBM_YDBQueueRaw205 INSERT INTO @DBQueueElements_478459(object,206 subobject,207 genprocid)208 SELECT209 x.uid,210 NULL,211 @GenProcID212 FROM(213 SELECT214 DISTINCT t.TableName AS UID215 FROM inserted i216 JOIN DialogTable t217 ON i.UID_DialogTable = t.UID_DialogTable) AS x218 EXEC QBM_PDBQueueInsert_Bulk 'QBM-K-IndexCreateGenerated',219 @DBQueueElements_478459220 END221 END TRY222 BEGIN CATCH223 EXEC QBM_PSessionErrorAdd DEFAULT224 RAISERROR('',225 18,226 1)227 WITH NOWAIT228 END CATCH229 ende:230 RETURN231END
Open raw exported source
1 create trigger QBM_TUDialogColumn on DialogColumn for Update not for Replication as begin declare @ConditionsToCheck QBM_YParameterList2 declare @XUser nvarchar(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() BEGIN TRY if exists (select top 1 1 from inserted) goto start3 if exists (select top 1 1 from deleted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') if4 update(isDynamicFK) begin if exists (select top 1 1 from dialogColumn c join deleted d on c.uid_DialogColumn = d.uid_dialogcolumn join dialogtable t on5 c.uid_dialogtable = t.uid_dialogtable join (select 'WatchOperation' as TableName, 'ObjectKey' as Columnname union all select 'QBMTaggedChange', 'ObjectKey'6 union all select 'DialogTaggedItem', 'ObjectKey' union all select 'DialogWatchOperation', 'ObjectKeyOfRow' ) as x on x.TableName = t.TableName and x.columnname7 = c.columnname where c.isDynamicFK = 1 ) begin RAISERROR( '#LDS#Cannot set property isDynamicFK to true in this column|' , 18, 2) WITH NOWAIT end end 8 if update(preprocessorcondition) begin if exists (select top 1 1 from dialogcolumn c join deleted d on c.uid_dialogColumn = d.uid_dialogcolumn and9 isnull(c.preprocessorcondition,N'') > ' ' and isnull(d.preprocessorcondition,N'') = N'' join DialogTable t on c.UID_DialogTable = t.UID_DialogTable join10 information_schema.columns sc on t.TableName = sc.table_name and c.columnname = sc.column_name and sc.IS_NULLABLE = 'No' ) begin raiserror('#LDS#Preprocessor conditions on columns without null are not allowed.|'11 , 18,1) end end if update(preprocessorcondition) begin insert into @ConditionsToCheck (ContentFull) select i.PreProcessorCondition from inserted i exec12 QBM_PPrePropCheckSyntax @ConditionsToCheck declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object, subobject, genprocid)13 select x.uid, null, @GenProcID from (select i.uid_dialogColumn as UID from DialogColumn i join deleted d on d.uid_dialogColumn = i.uid_dialogColumn and14 isnull(d.PreprocessorCondition,N'') <> isnull(i.PreprocessorCondition,N'') ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropColumn', @DBQueueElements_0115 declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02 (object, subobject, genprocid) select dbo.QBM_FGITableName(x.uid), null, @GenProcID16 from (select distinct i.UID_DialogTable as UID from DialogColumn i join deleted d on d.uid_dialogColumn = i.uid_dialogColumn and isnull(d.PreprocessorCondition17,N'') <> isnull(i.PreprocessorCondition,N'') and isnull(i.ispkmember,0) = 1 ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonPrepropTable', @DBQueueElements_0218 end if update(IsOverwritingTemplate) or update(Template) or update(Format) or update(FormatScript) begin update dialogcolumn set IsTemplateChanged = 191 , XDateUpdated = @Xdate , XUserUpdated = @XUser where uid_dialogcolumn in (select uid_dialogcolumn from inserted) and isnull(IsTemplateChanged,0) = 020 end if update(SplittedLookupSupport) begin declare @DBQueueElements_03 QBM_YDBQueueRaw insert into @DBQueueElements_03 (object, subobject, genprocid21) select x.uid, null, @GenProcID from (select c.UID_DialogColumn as UID from deleted d join DialogColumn c on d.UID_DialogColumn = c.UID_DialogColumn where22 isnull(d.SplittedLookupSupport, '') <> isnull(c.SplittedLookupSupport, '') ) as x delete QBMSplittedLookup from QBMSplittedLookup s join @DBQueueElements_0323 e on s.UID_DialogColumn = e.Object delete @DBQueueElements_03 from @DBQueueElements_03 e join DialogColumn c on c.UID_DialogColumn = e.Object where isnull24(c.SplittedLookupSupport, '') = '' exec QBM_PDBQueueInsert_Bulk 'QBM-K-SplittedLookupFill', @DBQueueElements_03 end if update (IsDeactivatedByPreProcessor25) or update (IsForeignKey) or update(IsDynamicFK) begin declare @DBQueueElements_36836 QBM_YDBQueueRaw insert into @DBQueueElements_36836(Object, SubObject26, GenProcID) select x.uid, null, @GenProcID from ( select ra.UID_DialogTableParent as uid from deleted d join DialogColumn c on d.UID_DialogColumn = c.UID_DialogColumn27 join QBM_VQBMRelationALL ra on c.UID_DialogTable = ra.UID_DialogTableChild where isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor28, 0) or isnull(d.IsForeignKey, '') <> isnull(c.IsForeignKey, '') or isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '') union select ra.UID_DialogTableChild29 from deleted d join DialogColumn c on d.UID_DialogColumn = c.UID_DialogColumn join QBM_VQBMRelationALL ra on c.UID_DialogTable = ra.UID_DialogTableParent30 where isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor, 0) or isnull(d.IsForeignKey, '') <> isnull(c.IsForeignKey, '')31 or isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '') union select c.UID_DialogTable from deleted d join DialogColumn c on d.UID_DialogColumn = c.UID_DialogColumn32 where isnull(d.IsDeactivatedByPreProcessor, 0) <> isnull(c.IsDeactivatedByPreProcessor, 0) or isnull(d.IsForeignKey, '') <> isnull(c.IsForeignKey, '')33 or isnull(d.IsDynamicFK, '') <> isnull(c.IsDynamicFK, '') ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-MissingDisplayRightFill', @DBQueueElements_36836 34 declare @DBQueueElements_478459 QBM_YDBQueueRaw insert into @DBQueueElements_478459 (object, subobject, genprocid) select x.uid, null, @GenProcID from35 (select distinct t.TableName as UID from inserted i join DialogTable t on i.UID_DialogTable = t.UID_DialogTable ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-IndexCreateGenerated'36, @DBQueueElements_478459 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 37