dbo.QBM_PIndexCreateGenerated_XO
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:28.910 · modified 2026-04-14T23:20:25.563 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TableNamePattern | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PIndexCreate | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| dbo | QBM_FGICodeName | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQIndexDef | 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_PIndexCreateGenerated_XO (@TableNamePattern varchar(30) ) as begin declare @ColumnName varchar(30) declare @Tablename 2 varchar(30) declare @Indexname varchar(30) declare @ElementBufferMulti QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @HasXIsInEffect 3 bit declare @HasXOrigin bit declare @HasInheritInfo bit declare @XList nvarchar(max) declare @DebugSwitch int = 0 SET XACT_ABORT OFF BEGIN TRY insert 4 into @ElementBufferMulti (Ident2, Ident1, Bit1, Int1, Int2) select c.COLUMN_NAME, c.TABLE_NAME , sign(len(isnull(ce.COLUMN_NAME, ''))) as HasXIsInEffect 5 , sign(len(isnull(co.COLUMN_NAME, ''))) as HasXOrigin , sign(len(isnull(ci.COLUMN_NAME, ''))) as HasInheritInfo from INFORMATION_SCHEMA.COLUMNS c with 6 (readpast) join sys.tables ts with (readpast) on c.TABLE_NAME = ts.name collate database_default and ts.type = 'U' join sys.schemas s with (readpast 7) on ts.schema_id = s.schema_id and s.name = 'dbo' join sys.columns cs with (readpast) on ts.object_id = cs.object_id and cs.name = c.COLUMN_NAME collate 8 database_default left outer join INFORMATION_SCHEMA.COLUMNS co with (readpast) on co.TABLE_NAME = c.TABLE_NAME and co.Column_Name = 'XOrigin' left outer 9 join INFORMATION_SCHEMA.COLUMNS ce with (readpast) on c.TABLE_NAME = ce.TABLE_NAME and ce.COLUMN_NAME = 'XIsInEffect' left outer join INFORMATION_SCHEMA.COLUMNS 10 ci with (readpast) on c.TABLE_NAME = ci.TABLE_NAME and ci.COLUMN_NAME = 'InheritInfo' where c.CHARACTER_MAXIMUM_LENGTH = 138 and c.COLUMN_NAME = 'XObjectKey' 11 and c.TABLE_NAME like @TableNamePattern and ts.is_memory_optimized = 0 order by 1 select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex 12 <= @ElementCount begin select top 1 @ColumnName = bu.Ident2 , @Tablename = bu.Ident1 , @HasXIsInEffect = bu.Bit1 , @HasXOrigin = bu.Int1 , @HasInheritInfo 13 = bu.Int2 from @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex select @XList = '' if @HasXOrigin = 1 begin select @XList= 'Xorigin' end if 14 @HasXIsInEffect = 1 begin select @XList = @XList + ', XIsInEffect' end if @HasInheritInfo = 1 begin select @XList = 'InheritInfo' end select @Indexname 15 = dbo.QBM_FGICodeName('XO', @TableName + @ColumnName ) if @DebugSwitch > 0 begin print @indexname select dbo.QBM_FSQIndexDef(@Tablename, '%') print concat 16(@ColumnName, '(', @XList, ')' ) end exec QBM_PIndexCreate @TableName, @indexname, 1, @columnname , @XList select @ElementIndex += 1 end END TRY BEGIN 17 CATCH declare @ErrorMessage nvarchar(4000) declare @ErrorSeverity int declare @ErrorState int select @ErrorSeverity = ERROR_SEVERITY() if @ErrorSeverity 18 > 18 begin select @ErrorSeverity = 18 end select @ErrorState = 1 select @ErrorMessage = isnull(ERROR_MESSAGE() , '<no message>') RAISERROR (@ErrorMessage 19, @ErrorSeverity, @ErrorState) WITH NOWAIT END CATCH ende: 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.563
has TRY/CATCH error handling
Summary: calls QBM_PIndexCreate; writes INSERT into; reads/joins INFORMATION_SCHEMA, sys
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TableNamePattern | varchar(30) | input |
DML targets
INSERT intoCalled routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @TableNamePattern @ColumnName @Tablename @Indexname @ElementBufferMulti @ElementCount @ElementIndex @HasXIsInEffect @HasXOrigin @HasInheritInfo @XList @DebugSwitch @ROWCOUNT @TableName @indexname @columnname @ErrorMessage @ErrorSeverity @ErrorState
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.QBM_PIndexCreateGenerated | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PIndexCreateGenerated_XO_M | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PIndexCreateGenerated | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PIndexCreateGenerated_XO_M | source text reference | has TRY/CATCH error handling |