dbo.QBM_PTriggerDisable
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:00.530 · modified 2026-04-14T23:14:10.113 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TablePattern | nvarchar | no |
@TriggerPattern | nvarchar | no |
@UseTriggerPatternForNotLike | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogDatabase | OBJECT_OR_COLUMN | ||
| QBM_PExecuteSQLWithRetry_LLP | OBJECT_OR_COLUMN | ||
| QBM_PIndicatorChange | OBJECT_OR_COLUMN | ||
| QBM_PJournal | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| dbo | QBM_FCVIntToString | 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_PTriggerDisable (@TablePattern nvarchar(64)= '%' ,@TriggerPattern nvarchar(64) = '%' ,@UseTriggerPatternForNotLike bit 2 = 0 ) as begin declare @musterTrigger nvarchar(1024) declare @SQLcmd nvarchar(max) declare @TabAktuell nvarchar(64) declare @TableType varchar(16) declare 3 @Triggername nvarchar(64) declare @elements QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @JournalMessage nvarchar(1000 4) declare @DebugSwitch int = 0 declare @DebugLevel varchar(1) = 'I' declare @MessageType varchar(1) = 'W' declare @CountElementsChanged int = 0 SET XACT_ABORT 5 OFF BEGIN TRY set nocount on select @musterTrigger = N'alter %type% "%table%" disable trigger %triggername% ' insert into @elements(LongIdent1, Ident2 6, LongIdent2) select distinct o.name , case o.type when 'U' then 'Table' else '' end as TableType , case @TriggerPattern when '%' then 'all' else '"' 7+ t.name + '"' end as Triggername from sys.tables o join sys.triggers t on o.object_id = t.parent_id join sys.schemas s on o.schema_id = s.schema_id where 8 o.type in( 'U' ) and o.is_memory_optimized = 0 and o.name like @TablePattern and s.name = 'dbo' and t.is_disabled = 0 and t.name != 'QBM_TUIndicator474488' 9 and ( @UseTriggerPatternForNotLike = 0 and t.name like @TriggerPattern or @UseTriggerPatternForNotLike = 1 and t.name not like @TriggerPattern ) and 10not (@TablePattern = '%' and @TriggerPattern = '%' and t.name = 'QBM_TIQBMGuidReplace' ) order by 1 select @ElementCount = @@ROWCOUNT if @ElementCount 11 > 0 begin exec QBM_PIndicatorChange 0 end select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @TabAktuell = bu.LongIdent1 12 , @TableType = bu.Ident2 , @TriggerName = bu.LongIdent2 from @elements bu where bu.ElementIndex = @ElementIndex select @SQLcmd = replace(replace(replace 13(@musterTrigger , '%table%', @TabAktuell) , '%type%', @TableType) , '%triggername%', @Triggername) if @DebugSwitch > 0 begin print @SQLcmd end exec QBM_PExecuteSQLWithRetry_LLP 14 @SQLStatement = @SQLcmd , @LockTimeout_ms = 2500 , @MaxWaitTimeForLock_s = 10 , @ProcIDForJournal = @@procid , @HandleErrorSilent = 0 , @ExecuteWithTransact 15 = 0 select @CountElementsChanged += 1 select @ElementIndex += 1 end if @CountElementsChanged > 0 and exists (select top 1 1 from sys.objects o where 16o.name = 'QBM_PJournal' and type = 'P' ) begin select @JournalMessage = '#LDS#System elements modified by {0}, pattern {1}, elements affected {2}.|' + 17isnull(OBJECT_NAME(@@procid), '') + '|' + @TablePattern + '|' + dbo.QBM_FCVIntToString(@CountElementsChanged) + '|' if not exists (select top 1 1 from 18 DialogDatabase where IsMainDatabase = 1 and UpdatePhase <> 0) and not exists (select top 1 1 from sys.tables t with (readpast) join sys.columns c with 19 (readpast) on t.object_id = c.object_id where t.name = 'DialogDatabase' and c.name = 'InitialMigrationRunning' ) begin exec QBM_PJournal @JournalMessage 20, @@procid, @MessageType, @DebugLevel, 20 end else begin exec QBM_PJournal @JournalMessage, @@procid, 'I', 'I' end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd 21 default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 22
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.113
has TRY/CATCH error handling
Summary: calls QBM_PIndicatorChange, QBM_PExecuteSQLWithRetry_LLP, QBM_PJournal, QBM_PSessionErrorAdd; writes INSERT into; reads/joins sys, DialogDatabase
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@TablePattern | nvarchar(64) | input |
@TriggerPattern | nvarchar(64) | input |
@UseTriggerPatternForNotLike | bit | input |
DML targets
INSERT intoRead/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: #LDS #System
Variables: @TablePattern @TriggerPattern @UseTriggerPatternForNotLike @musterTrigger @SQLcmd @TabAktuell @TableType @Triggername @elements @ElementCount @ElementIndex @JournalMessage @DebugSwitch @DebugLevel @MessageType @CountElementsChanged @ROWCOUNT @TriggerName @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @procid @HandleErrorSilent @ExecuteWithTransact @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_PDeleteDeep_L | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_ZConstraintDisable | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PDeleteDeep_L | source text reference | inserts DBQueue tasks, has TRY/CATCH error handling |
| dbo.QBM_ZConstraintDisable | source text reference | has TRY/CATCH error handling |