dbo.QBM_PMNTableInsert
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:29.613 · modified 2026-04-14T23:20:26.373 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TargetTable | varchar | no |
@ElementColumn | varchar | no |
@AssignedElementColumn | varchar | no |
@TargetIsView | bit | no |
@FKTableNameElement | varchar | no |
@FKColumnNameElement | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogColumn | OBJECT_OR_COLUMN | ||
| DialogTable | OBJECT_OR_COLUMN | ||
| JobChain | OBJECT_OR_COLUMN | ||
| JobEventGen | OBJECT_OR_COLUMN | ||
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionContextSet | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QBMEvent | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGIColumnExists | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create procedure QBM_PMNTableInsert (@TargetTable varchar(30) , @ElementColumn varchar(30) , @AssignedElementColumn varchar(30) , @TargetIsView 2 bit = 0 , @FKTableNameElement varchar(30) = '' , @FKColumnNameElement varchar(30) = '' ) as begin declare @GenProcID varchar(38) declare @SQLCmdInsert 3 nvarchar(max) = N'' declare @SQLCmdFire nvarchar(max) = N'' declare @SQLAction nvarchar(max) declare @InsertLine nvarchar(max) declare @SelectLine nvarchar 4(max) declare @TargetTableView varchar(30) declare @UID_DialogTableTarget varchar(38) declare @IsAssignmentWithEvent bit declare @DebugSwitch int = 0 5 declare @EventName nvarchar(64) declare @ExistsXObjectKey bit declare @ExistsXOrigin bit declare @ExistsXIsInEffect bit declare @GenProcID_R varchar(38 6) = dbo.QBM_FGISessionContext('') declare @XUser_R nvarchar(64) = dbo.QBM_FGISessionContext('XUser') declare @ElementCount int declare @ElementIndex int 7 declare @DifferentTables QBM_YCursorBuffer declare @ElementCountDifferentTables int declare @ElementIndexDifferentTables int declare @ElementLastDifferentTables 8 int declare @MaxWaitTimeForMainOperation float = 8.0 SET XACT_ABORT OFF BEGIN TRY select top 1 @UID_DialogTableTarget = t.UID_DialogTable , @IsAssignmentWithEvent 9 = t.isAssignmentWithEvent from DialogTable t with (readpast) where t.TableName = @TargetTable select @ExistsXObjectKey = dbo.QBM_FGIColumnExists(@TargetTable 10, 'XObjectKey') select @ExistsXOrigin = dbo.QBM_FGIColumnExists(@TargetTable, 'XOrigin') select @ExistsXIsInEffect = dbo.QBM_FGIColumnExists(@TargetTable 11, 'XIsInEffect') select @InsertLine = concat(' 12 insert into ' , @TargetTable , ' ( ' , @ElementColumn , ' , ' , @AssignedElementColumn ) select @SelectLine 13 = ' 14 select d.Element, d.AssignedElement ' if @ExistsXObjectKey = 1 begin select @InsertLine = concat(@InsertLine , ', XObjectKey') select @SelectLine 15 = concat(@SelectLine , ', @XObjectKey@') end if @ExistsXIsInEffect = 1 begin select @EventName = 'Assign' select @InsertLine = concat(@InsertLine , ', XIsInEffect' 16) select @SelectLine = concat(@SelectLine , ', d.XIsInEffect') end else begin select @EventName = 'Insert' end if @IsAssignmentWithEvent = 1 and not exists 17 (select top 1 1 from QBMEvent q with (readpast) join JobEventGen e with (readpast) on q.UID_QBMEvent = e.UID_QBMEvent join JobChain c on e.UID_JobChain 18 = c.UID_JobChain where q.UID_DialogTable = @UID_DialogTableTarget and q.EventName = @EventName and c.NoGenerate = 0 and c.IsDeactivatedByPreProcessor 19= 0 ) begin select @IsAssignmentWithEvent = 0 end if @ExistsXOrigin = 1 begin select @InsertLine = concat(@InsertLine , ', XOrigin') select @SelectLine 20 = concat(@SelectLine , ', d.XOrigin') end if exists(select top 1 1 from DialogColumn c with (readpast) where c.UID_DialogTable = @UID_DialogTableTarget 21 and c.ColumnName = 'XdateInserted' ) begin select @InsertLine = concat(@InsertLine , ', XDateInserted , XDateUpdated , XUserInserted , XUserUpdated ' 22) select @SelectLine = concat(@SelectLine , ', getutcdate() , getutcdate() , ''QBM_DBQueueProcess'' , ''QBM_DBQueueProcess'' ') end select @SQLCmdInsert 23 = concat(@InsertLine , ')' , @SelectLine , ' 24 from #QBMDeltaInsert d 25 where d.GenProcID = ''@GenProciD'' 26 and Not exists (select top 1 1 27 from ' 28 , @TargetTable , ' z 29 where z.' , @ElementColumn , ' = d.element 30 and z.' , @AssignedElementColumn , ' = d.AssignedElement 31 )' ) 32 if @TargetIsView = 0 begin if @IsAssignmentWithEvent = 1 begin select @SQLCmdFire = ' 33 declare @EntriesToFire QBM_YParameterList 34 declare @AddonElements QBM_YParameterList 35 36 insert into @EntriesToFire(Parameter1) 37 select @XObjectKey@ 38 from #QBMDeltaInsert d 39 where d.GenProcID = ''@GenProciD'' 40 ' 41 if @ExistsXIsInEffect = 1 begin select @SQLCmdFire = concat(@SQLCmdFire , ' 42 and d.XIsInEffect = 1 43 ' ) end if @FKTableNameElement > ' ' and @FKColumnNameElement 44 > ' ' begin select @SQLCmdFire = concat(@SQLCmdFire , ' 45 46 insert into @AddonElements(Parameter1, Parameter2) 47 select distinct x.XObjectKey, @XObjectKey@ 48 from #QBMDeltaInsert d join ' 49 , @FKTableNameElement , ' x on x.' , @FKColumnNameElement , ' = d.Element 50 where d.GenProcID = ''@GenProciD'' 51 ' ) end select @SQLCmdFire = concat 52(@SQLCmdFire , ' 53 54 exec QBM_PJobCreate_HOFireEvent_L ''' , @TargetTable , ''', @EntriesToFire, ''' , @EventName , ''', ''@GenProcID'' 55 , @AddonElements 56 , @isToFreezeOnError = 1 57 58 ' 59 ) end select @SQLCmdInsert = REPLACE(@SQLCmdInsert, '@XObjectKey@', concat('dbo.QBM_FCVElementToObjectKey2(''' , @TargetTable , ''', ''' , @ElementColumn 60 , ''', d.Element, ''' , @AssignedElementColumn , ''', d.AssignedElement)' ) ) select @SQLCmdFire = REPLACE(@SQLCmdFire, '@XObjectKey@', concat('dbo.QBM_FCVElementToObjectKey2(''' 61 , @TargetTable , ''', ''' , @ElementColumn , ''', d.Element, ''' , @AssignedElementColumn , ''', d.AssignedElement)') ) end else begin select @SQLCmdFire 62 = ' 63 declare @EntriesToFire QBM_YParameterList 64 declare @AddonElements QBM_YParameterList 65 66 insert into @EntriesToFire(Parameter1) 67 select @XObjectKey@ 68 from #QBMDeltaInsert d 69 where d.GenProcID = ''@GenProciD'' 70 and d.TargetTableView = ''@TargetTableView@'' 71 ' 72 if @ExistsXIsInEffect = 1 begin select @SQLCmdFire = concat(@SQLCmdFire , ' 73 and d.XIsInEffect = 1 74 ' ) end if @FKTableNameElement > ' ' and @FKColumnNameElement 75 > ' ' begin select @SQLCmdFire = concat(@SQLCmdFire , ' 76 insert into @AddonElements(Parameter1, Parameter2) 77 select distinct x.XObjectKey, @XObjectKey@ 78 from #QBMDeltaInsert d join ' 79 , @FKTableNameElement , ' x on x.' , @FKColumnNameElement , ' = d.Element 80 where d.GenProcID = ''@GenProciD''
Module relation graph
Loading module relation graph…
Source-derived context
Generated from exported SQL module definitions plus read-only sandbox sys.objects/sys.parameters/sys.sql_expression_dependencies metadata. This is factual source evidence, not a semantic guess.
provenance: SQL definition export provenance: sandbox DB metadata modified: 2026-04-14T23:20:26.373
creates object-layer jobs via QBM_PJobCreate* fires object-layer event via HOFireEvent uses session context values has TRY/CATCH error handling
Summary: calls QBM_PJobCreate_HOFireEvent_L, QBM_PSessionContextSet, QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; writes INSERT into; reads/joins DialogTable, QBMEvent, JobEventGen, JobChain, DialogColumn; uses session context XUser, GenProcID
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TargetTable | varchar(30) | input |
@ElementColumn | varchar(30) | input |
@AssignedElementColumn | varchar(30) | input |
@TargetIsView | bit | input |
@FKTableNameElement | varchar(30) | input |
@FKColumnNameElement | varchar(30) | input |
DML targets
INSERT intoCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: XUser GenProcID
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #QBMDeltaInsert
Variables: @TargetTable @ElementColumn @AssignedElementColumn @TargetIsView @FKTableNameElement @FKColumnNameElement @GenProcID @SQLCmdInsert @SQLCmdFire @SQLAction @InsertLine @SelectLine @TargetTableView @UID_DialogTableTarget @IsAssignmentWithEvent @DebugSwitch @EventName @ExistsXObjectKey @ExistsXOrigin @ExistsXIsInEffect @GenProcID_R @XUser_R @ElementCount @ElementIndex @DifferentTables @ElementCountDifferentTables @ElementIndexDifferentTables @ElementLastDifferentTables @MaxWaitTimeForMainOperation @XObjectKey @GenProciD @EntriesToFire @AddonElements @isToFreezeOnError @GenProcIDs_CountInsert @ROWCOUNT @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal
Referenced by / reverse dependencies
Generated from live DB metadata, FK rows, and exported SQL dependency/source extraction. This is factual linkage evidence, not inferred behavior.
| Referencing object | Relation | Evidence |
|---|---|---|
| dbo.ADS_ZAccountInADSGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ADS_ZADSMachineInADSGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ADS_ZContactInADSGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ADS_ZOrgHasADSGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA104261FA54379C6160FAE8F6 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA11AF8D16C61275A2DCFAED6E | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA32EFCA6201B15CB29D954994 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA6BF9FD71303E4D8F82AD2566 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA72A423016BA139FFC3D8EDFF | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PA98D6CE53656FFB7523357E71 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PACB9B89D5F903FDF8F2FAD40D | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PAD1085733B383217D4E3F0797 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PAD601362D0C4E22FD4721754B | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PAE14BB3C2EDA7D127BCA29F96 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PD0C461BCE9B1499A948C6DE89 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PD75EFC2994CF76773E86FDA0A | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PD7750F63D2FE88D966B93F426 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PD85D31B610579F7BE495D13A3 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PD88D54946ECC34815B5EF8AA7 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PDA305E8EEC3AE04AAA39FD671 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PDB81C19C7C55B5C62A0191559 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PDBB056A1F7CFF0CE82AAA3734 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PDBDCABA4BA9EB91B037DD3763 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.GEN_PDEC582A34382551F1DDFD9799 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.LDP_ZAccountInLDAPGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.LDP_ZLDPMachineInLDAPGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.LDP_ZOrgHasLDAPGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZHelperHardwareOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZHelperHeadOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZHelperHeadPerson | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZHelperPersonOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZHelperWorkDeskOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZOrgHasQERAssign | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZOrgHasQERResource | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZOrgHasQERReuse | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZOrgHasQERReuseUS | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZPersonHasQERAssign | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZPersonHasQERResource | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZPersonHasQERReuse | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZPersonHasQERReuseUS | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMB_ZHelperHardwareOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMB_ZHelperPersonOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMB_ZHelperWorkDeskOrg | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMS_ZOrgHasESet | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMS_ZPersonHasESet | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RMS_ZWorkDeskHasESet | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RPS_ZOrgHasRPSReport | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.RPS_ZPersonHasRPSReport | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZOrgHasTSBAccountDef | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZOrgHasUNSGroupB | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZOrgHasUNSGroupB1 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZOrgHasUNSGroupB2 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZOrgHasUNSGroupB3 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZPersonHasTSBAccountDef | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSAccountBHasUNSItemB | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSAccountBInUNSGroupB | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSAccountBInUNSGroupB1 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSAccountBInUNSGroupB2 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSAccountBInUNSGroupB3 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.TSB_ZUNSGroupBHasUNSItemB | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ADS_ZAccountInADSGroup | source text reference | has TRY/CATCH error handling |
| dbo.ADS_ZADSMachineInADSGroup | source text reference | has TRY/CATCH error handling |
| dbo.ADS_ZContactInADSGroup | source text reference | has TRY/CATCH error handling |
| dbo.ADS_ZOrgHasADSGroup | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.CPL_PComplianceCheckMakeProc_h | source text reference | has TRY/CATCH error handling |
| dbo.LDP_ZAccountInLDAPGroup | source text reference | has TRY/CATCH error handling |
| dbo.LDP_ZLDPMachineInLDAPGroup | source text reference | has TRY/CATCH error handling |
| dbo.LDP_ZOrgHasLDAPGroup | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_PDynamicGroupMakeProc_hlp | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZHelperHardwareOrg | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_ZHelperHeadOrg | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZHelperHeadPerson | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZHelperPersonOrg | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZHelperWorkDeskOrg | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZOrgHasQERAssign | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_ZOrgHasQERResource | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_ZOrgHasQERReuse | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_ZOrgHasQERReuseUS | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QER_ZPersonHasQERAssign | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZPersonHasQERResource | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZPersonHasQERReuse | source text reference | has TRY/CATCH error handling |
| dbo.QER_ZPersonHasQERReuseUS | source text reference | has TRY/CATCH error handling |
| dbo.RMB_ZHelperHardwareOrg | source text reference | has TRY/CATCH error handling |
| dbo.RMB_ZHelperPersonOrg | source text reference | has TRY/CATCH error handling |
| dbo.RMB_ZHelperWorkDeskOrg | source text reference | has TRY/CATCH error handling |
| dbo.RMS_ZOrgHasESet | source text reference | has TRY/CATCH error handling |
| dbo.RMS_ZPersonHasESet | source text reference | has TRY/CATCH error handling |
| dbo.RMS_ZWorkDeskHasESet | source text reference | has TRY/CATCH error handling |
| dbo.RPS_ZOrgHasRPSReport | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.RPS_ZPersonHasRPSReport | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZOrgHasTSBAccountDef | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.TSB_ZOrgHasUNSGroupB | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.TSB_ZOrgHasUNSGroupB1 | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.TSB_ZOrgHasUNSGroupB2 | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.TSB_ZOrgHasUNSGroupB3 | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.TSB_ZPersonHasTSBAccountDef | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSAccountBHasUNSItemB | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSAccountBInUNSGroupB | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSAccountBInUNSGroupB1 | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSAccountBInUNSGroupB2 | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSAccountBInUNSGroupB3 | source text reference | has TRY/CATCH error handling |
| dbo.TSB_ZUNSGroupBHasUNSItemB | source text reference | has TRY/CATCH error handling |