dbo.QBM_PGIDBServerIndexRebuildOpt
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:01.707 · modified 2026-04-14T23:14:10.570 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TableName | varchar | no |
@RebuildOptions | nvarchar | yes |
@AllowPageLock | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogTable | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_VServerEngineProperties | 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_PGIDBServerIndexRebuildOpt(@TableName varchar(30) , @RebuildOptions nvarchar(max) output , @AllowPageLock bit = 1 ) as 2 begin declare @erg nvarchar(max) declare @SizeOfTableMB float declare @FreeSpaceTempDB float = 0.0 declare @AccessToFileSpaceUsage bit declare @UseUse 3 bit , @OnlineIndexing bit SET XACT_ABORT OFF BEGIN TRY select top 1 @UseUse = v.UseUse , @OnlineIndexing = v.OnlineIndexing , @AccessToFileSpaceUsage 4= v.AccessToFileSpaceUsage from QBM_VServerEngineProperties v select top 1 @SizeOfTableMB = isnull(isnull(b.SizeMB, t.SizeMB), 0.0) from DialogTable t 5with (readpast) left outer join DialogTable b with (readpast) on t.UID_DialogTableBase = b.UID_DialogTable where t.TableName = @TableName if @UseUse = 61 and @AccessToFileSpaceUsage = 1 begin select top 1 @FreeSpaceTempDB = (SUM(unallocated_extent_page_count)*1.0/128.0) FROM tempdb.sys.dm_db_file_space_usage 7 end select @RebuildOptions = concat(' REBUILD with (SORT_IN_TEMPDB = ' , case when @UseUse = 0 then 'ON' when @SizeOfTableMB * 5.0 < @FreeSpaceTempDB 8 then 'ON' else 'OFF' end , ' 9 , Fillfactor = 100 10 , PAD_Index = ON 11 , ALLOW_PAGE_LOCKS = ', case @AllowPageLock when 1 then 'ON' 12else 'OFF' end , ' 13 , MAXDOP = 1 14 ' , case @OnlineIndexing when 1 then ', ONLINE = ON' else '' end , ' 15 )' ) END TRY BEGIN CATCH exec 16 QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: 17 return end 18
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:14:10.570
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; reads/joins QBM_VServerEngineProperties, DialogTable, tempdb
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TableName | varchar(30) | input |
@RebuildOptions | nvarchar | OUTPUT |
@AllowPageLock | bit | input |
DML targets
None extracted.Called 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: @TableName @RebuildOptions @AllowPageLock @erg @SizeOfTableMB @FreeSpaceTempDB @AccessToFileSpaceUsage @UseUse @OnlineIndexing @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 object | Relation | Evidence |
|---|---|---|
| dbo.QBM_PIndexEnable | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PIndexRebuild | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PTableReindex | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PIndexEnable | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PIndexRebuild | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_PTableReindex | source text reference | has TRY/CATCH error handling |