dbo.QBM_PTableLockEscalationSet
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:28.767 · modified 2026-04-14T23:20:25.397 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TablePattern | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YParameterList | TYPE | ||
| 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_PTableLockEscalationSet(@TablePattern varchar(64) ) as begin declare @tablename varchar(30) declare @SQLCmd nvarchar(max 2) declare @DebugSwitch int = 0 declare @AllNames QBM_YParameterList SET XACT_ABORT OFF BEGIN TRY if @@TRANCOUNT > 0 begin goto endLabel end select @SQLCmd 3 = ' select t.name 4 from sys.tables t 5 where 6 t.lock_escalation <> 1 7 %xtp% and t.is_memory_optimized = 0 8 and t.type = ''U'' 9 and t.is_ms_shipped = 0 10 and t.name not in ( 11 ''sysdiagrams'' 12 ) 13 and t.name like ''' 14 + @TablePattern + ''' 15 16 ' if ISNULL(SERVERPROPERTY('IsXTPSupported'), 0) = 1 begin select @SQLCmd = replace(@SQLcmd, '%xtp%', '') end else begin select 17 @SQLCmd = replace(@SQLcmd, '%xtp%', '--') end if @DebugSwitch > 0 begin print @SQLCmd end insert into @AllNames(Parameter1) exec sp_executesql @SQLcmd 18 if @@ROWCOUNT = 0 begin goto endLabel end if @DebugSwitch > 0 begin select Parameter1 from @AllNames end select @tablename = '#' while @tablename > ' ' 19 begin select @tablename = null select top 1 @tablename = a.Parameter1 from @AllNames a if @tablename is null begin continue end else begin delete @AllNames 20 where Parameter1 = @tablename end select @SQLCmd = ' 21 alter table ' + @TableName + ' set (LOCK_ESCALATION = DISABLE) 22 ' if @DebugSwitch > 0 begin 23print @sqlcmd end exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal 24 = @@procid , @HandleErrorSilent = 0 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow 25() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 26
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.397
has TRY/CATCH error handling
Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; reads/joins sys
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TablePattern | varchar(64) | 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: @TablePattern @tablename @SQLCmd @DebugSwitch @AllNames @TRANCOUNT @SQLcmd @ROWCOUNT @TableName @sqlcmd @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @procid @HandleErrorSilent @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_PIndexRebuild | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_ZIndexCreateGenerated | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_ZTriggerWatchCreate | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_ZTriggerWatchCreate_S | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PIndexRebuild | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_ZIndexCreateGenerated | source text reference | has TRY/CATCH error handling |
| dbo.QBM_ZTriggerWatchCreate | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QBM_ZTriggerWatchCreate_S | source text reference | has TRY/CATCH error handling |