dbo.QBM_PIndexCreateGenerated_XR

SQL_STORED_PROCEDURE

Created 2025-06-27T17:57:28.980 · modified 2026-04-14T23:20:25.647 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@TableNamevarcharno

Referenced objects

SchemaObjectColumn/minorClass
DialogColumnOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
QBM_PIndexCreateOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_VHeavyLoadTablesOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBMVNonUniqueMAllTableOBJECT_OR_COLUMN
dboQBM_FGICodeNameOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1   create   procedure QBM_PIndexCreateGenerated_XR (@TableName varchar(30) ) as begin declare @ColumnNameO varchar(30) declare @ColumnNameF varchar
2(30) declare @Indexname varchar(30) declare @ColumnList nvarchar(max) declare @DebugSwitch int = 0  declare @ElementBufferMulti QBM_YCursorBuffer declare
3 @ElementCount int declare @ElementIndex int SET XACT_ABORT OFF BEGIN TRY if @TableName in ('QAMTrustee') begin goto endLabel end if not exists (select
4 top 1 1 from sys.objects o where name = 'QBMVNonUniqueMAllTable' ) begin if @TableName in ('QBMTaggedChange', 'QBMColumnTranslation') begin goto endLabel
5 end  if not exists (select top 1 1 from DialogTable t where t.TableName = @TableName and left(t.UID_DialogTable, 3) = 'QBM' ) begin goto endLabel end 
6end else begin if @TableName in (select TableName from QBMVNonUniqueMAllTable) begin goto endLabel end end   insert into @ElementBufferMulti (Ident1, Ident2
7) select x.ColumnObjectKey,x.ColumnNameFK from (  select tc.TableName, c.ColumnName as ColumnObjectKey, cf.ColumnName as ColumnNameFK from DialogTable 
8tc with (readpast) join DialogColumn c with (readpast) on c.UID_DialogTable = tc.UID_DialogTable and tc.TableType in ('B', 'T') and c.SchemaDataLen = 138
9 and c.ColumnName <> 'XObjectKey' join INFORMATION_SCHEMA.columns obc with (readpast) on obc.TABLE_NAME = tc.TableName and obc.COLUMN_NAME = c.ColumnName
10 and obc.IS_NULLABLE = 'NO' join DialogColumn cf with (readpast) on cf.UID_DialogTable = tc.UID_DialogTable and cf.SchemaDataLen = 38 and cf.IsPKMember
11 = 0 join INFORMATION_SCHEMA.columns obf with (readpast) on obf.TABLE_NAME = tc.TableName and obf.COLUMN_NAME = cf.ColumnName and obf.IS_NULLABLE = 'NO'
12 where tc.IsMAllTable = 1 and tc.TableName = @TableName ) as x  join sys.tables ts with (nolock) on x.TableName = ts.name collate database_default and 
13ts.type = 'U'  join sys.schemas s with (nolock) on ts.schema_id = s.schema_id and s.name = 'dbo' where not exists (Select top 1 1 from QBM_VHeavyLoadTables
14 h where h.TableName = x.TableName and h.IsNoAutoIndex = 1 ) order by 1,2 select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex
15 <= @ElementCount begin select top 1 @ColumnNameO = bu.Ident1 , @ColumnNameF = bu.Ident2 from @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex
16 select @Indexname = dbo.QBM_FGICodeName('XR', concat(@TableName , @ColumnNameO , @ColumnNameF)) if @DebugSwitch > 0 begin print @Indexname end select 
17@columnList = @ColumnNameO + ', ' + @ColumnNameF if @DebugSwitch > 0 begin print @columnList end exec QBM_PIndexCreate @TableName, @Indexname, 1, @columnList
18 select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() 
19RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 
20

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:25.647

has TRY/CATCH error handling

Summary: calls QBM_PIndexCreate, QBM_PSessionErrorAdd; writes INSERT into; reads/joins sys, DialogTable, QBMVNonUniqueMAllTable, DialogColumn, INFORMATION_SCHEMA…

Declared parameters

ParameterTypeDirection
@TableNamevarchar(30)input

DML targets

INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @TableName @ColumnNameO @ColumnNameF @Indexname @ColumnList @DebugSwitch @ElementBufferMulti @ElementCount @ElementIndex @ROWCOUNT @columnList @Rethrow

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 objectRelationEvidence
dbo.QBM_PIndexCreateGeneratedSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PIndexCreateGeneratedsource text referencehas TRY/CATCH error handling