dbo.DPR_TIDPRNameSpaceHasDialogTab
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 -> DPR-K-TriggerCreateMembership / DPR_ZTriggerCreateMembership at line 17
- References QBM_PDBQueueInsert_Bulk
- Trigger parent table: DPRNameSpaceHasDialogTable
Typed Edges
- queues DBQueue task DPR_ZTriggerCreateMembership at line 17 Bulk DBQueue insert -> DPR-K-TriggerCreateMembership / DPR_ZTriggerCreateMembership at line 17
- trigger on table DPRNameSpaceHasDialogTable Trigger parent table: DPRNameSpaceHasDialogTable
- 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_PSessionErrorAdd source text reference
- references source dbo.QBM_PSQLCheckExecutable source text reference
References
- dbo.QBM_FGISessionContext
- dbo.QBM_FGITableName
- dbo.QBM_PDBQueueInsert_Bulk
- dbo.QBM_PSessionErrorAdd
- dbo.QBM_PSQLCheckExecutable
Referenced By
- No direct source references extracted.
Complete Source
1CREATE trigger DPR_TIDPRNameSpaceHasDialogTab2 ON DPRNameSpaceHasDialogTable FOR3INSERT NOT FOR Replication4AS5BEGIN6 DECLARE @SQLToCheck QBM_YParameterList7 BEGIN TRY8 IF EXISTS(9 SELECT TOP 1 110 FROM inserted)11 GOTO start12 RETURN start:13 DECLARE @GenProcID varchar(38)14 SELECT @GenProcID = dbo.QBM_FGISessionContext('')15 IF EXISTS(16 SELECT TOP 1 117 FROM inserted i18 WHERE19 i.IsAdHocSingleMemberShip = 0 AND i.WhereClause > ' ')20 BEGIN21 RAISERROR('#LDS#Whereclauses only allowed for IsAdHocSingleMemberShip = 1.|',22 18,23 1)24 WITH NOWAIT25 END26 INSERT INTO @SQLToCheck(Parameter1,27 ContentFull)28 SELECT29 x.XObjectKey,30 'select top 1 1 as columnvalue from ' + x.MemberTable + ' as i31 where(32 ' + x.WhereClause + '33 )'34 FROM(35 SELECT36 r.ParentTable AS ContainerTable,37 r.childtable AS MemberTable,38 i.WhereClause,39 i.XObjectKey40 FROM QBM_VQBMRelation r41 JOIN DPRNameSpaceHasDialogTable nht42 ON r.UID_DialogTableChild = nht.UID_DialogTable AND r.IsForUpdateXDateSubItem = 143 JOIN QBM_VQBMRelation rm44 ON r.UID_QBMRelationMN = rm.UID_QBMRelation45 JOIN DialogTable tc46 ON r.ChildTable = tc.TableName AND tc.isMNTable = 147 JOIN inserted i48 ON i.UID_DialogTable = r.UID_DialogTableChild49 WHERE50 r.IsForUpdateXDateSubItem = 1 AND nht.IsAdHocSingleMemberShip = 1 AND i.WhereClause > ' '51 UNION52 SELECT53 r.ParentTable AS ContainerTable,54 dbo.QBM_FGITableName(rm.UID_DialogTableReference) AS MemberTable,55 i.WhereClause,56 i.XObjectKey57 FROM QBM_VQBMRelation r58 JOIN DPRNameSpaceHasDialogTable nht59 ON r.UID_DialogTableChild = nht.UID_DialogTable AND r.IsForUpdateXDateSubItem = 160 JOIN DialogColumn ok61 ON ok.UID_DialogTable = r.UID_DialogTableChild62 JOIN DialogValidDynamicRef rm63 ON ok.UID_DialogColumn = rm.UID_DialogColumn64 JOIN DialogTable tc65 ON ok.UID_DialogTable = tc.UID_DialogTable AND tc.IsMAllTable = 166 JOIN inserted i67 ON i.UID_DialogTable = r.UID_DialogTableChild68 WHERE69 r.IsForUpdateXDateSubItem = 1 AND nht.IsAdHocSingleMemberShip = 1 AND i.WhereClause > ' ') AS x70 EXEC QBM_PSQLCheckExecutable @SQLToCheck,71 @RaiseError = 172 DECLARE @DBQueueElements_01 QBM_YDBQueueRaw73 INSERT INTO @DBQueueElements_01(object,74 subobject,75 genprocid)76 SELECT77 dbo.QBM_FGITableName(x.uid),78 NULL,79 @GenProcID80 FROM(81 SELECT i.UID_DialogTable AS UID82 FROM inserted i) AS x83 EXEC QBM_PDBQueueInsert_Bulk 'DPR-K-TriggerCreateMembership',84 @DBQueueElements_0185 END TRY86 BEGIN CATCH87 EXEC QBM_PSessionErrorAdd DEFAULT88 RAISERROR('',89 18,90 1)91 WITH NOWAIT92 END CATCH93 ende:94 RETURN95END
Open raw exported source
1 create trigger DPR_TIDPRNameSpaceHasDialogTab on DPRNameSpaceHasDialogTable for Insert not for Replication as begin declare @SQLToCheck QBM_YParameterList2 BEGIN TRY if exists (select top 1 1 from inserted) goto start return start: declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext3('') if exists (select top 1 1 from inserted i where i.IsAdHocSingleMemberShip = 0 and i.WhereClause > ' ' ) begin RAISERROR ('#LDS#Whereclauses only allowed for IsAdHocSingleMemberShip = 1.|'4, 18, 1) WITH NOWAIT end insert into @SQLToCheck(Parameter1, ContentFull) select x.XObjectKey, 'select top 1 1 as columnvalue from ' + x.MemberTable + 5' as i6 where(7 '+ x.WhereClause + '8 )' from ( select r.ParentTable as ContainerTable , r.childtable as MemberTable, i.WhereClause, i.XObjectKey9 from QBM_VQBMRelation r join DPRNameSpaceHasDialogTable nht on r.UID_DialogTableChild = nht.UID_DialogTable and r.IsForUpdateXDateSubItem = 1 join QBM_VQBMRelation10 rm on r.UID_QBMRelationMN = rm.UID_QBMRelation join DialogTable tc on r.ChildTable = tc.TableName and tc.isMNTable = 1 join inserted i on i.UID_DialogTable11 = r.UID_DialogTableChild where r.IsForUpdateXDateSubItem = 1 and nht.IsAdHocSingleMemberShip = 1 and i.WhereClause > ' ' union select r.ParentTable as12 ContainerTable , dbo.QBM_FGITableName(rm.UID_DialogTableReference) as MemberTable, i.WhereClause, i.XObjectKey from QBM_VQBMRelation r join DPRNameSpaceHasDialogTable13 nht on r.UID_DialogTableChild = nht.UID_DialogTable and r.IsForUpdateXDateSubItem = 1 join DialogColumn ok on ok.UID_DialogTable = r.UID_DialogTableChild14 join DialogValidDynamicRef rm on ok.UID_DialogColumn = rm.UID_DialogColumn join DialogTable tc on ok.UID_DialogTable = tc.UID_DialogTable and tc.IsMAllTable15 = 1 join inserted i on i.UID_DialogTable = r.UID_DialogTableChild where r.IsForUpdateXDateSubItem = 1 and nht.IsAdHocSingleMemberShip = 1 and i.WhereClause16 > ' ' ) as x exec QBM_PSQLCheckExecutable @SQLToCheck, @RaiseError = 1 declare @DBQueueElements_01 QBM_YDBQueueRaw insert into @DBQueueElements_01 (object17, subobject, genprocid) select dbo.QBM_FGITableName(x.uid), null, @GenProcID from (select i.UID_DialogTable as UID from inserted i ) as x exec QBM_PDBQueueInsert_Bulk18 'DPR-K-TriggerCreateMembership', @DBQueueElements_01 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH19 ende: return end 20