dbo.QBM_PConstraintDisable
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:00.547 · modified 2026-04-14T23:14:10.150 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@TableName | nvarchar | 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_PConstraintDisable (@TableName nvarchar(64)= N'%' ) as begin declare @SQLcmd nvarchar(max) declare @TabAktuell nvarchar 2(64) declare @elements QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @JournalMessage nvarchar(1000) declare @DebugLevel 3 varchar(1) = 'I' declare @MessageType varchar(1) = 'W' declare @CountElementsChanged int = 0 declare @SQL nvarchar(max) SET XACT_ABORT OFF BEGIN TRY insert 4 into @elements (Ident2) select distinct c.name as TableName from sys.foreign_keys fk join sys.objects c on c.object_id = fk.parent_object_id join sys.objects 5 p on p.object_id = fk.referenced_object_id where fk.type = 'F' and (c.name like @TableName ) and (convert(int, fk.is_disabled)) = 0 select @ElementCount 6 = @@ROWCOUNT if @ElementCount > 0 begin exec QBM_PIndicatorChange 0 end select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 7 1 @TabAktuell = bu.Ident2 from @elements bu where bu.ElementIndex = @ElementIndex select @SQL = concat(' 8 alter Table ', @TabAktuell, ' nocheck constraint all ' 9) exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQL , @LockTimeout_ms = 2500 , @MaxWaitTimeForLock_s = 10 , @ProcIDForJournal = default , @HandleErrorSilent 10 = 0 , @ExecuteWithTransact = 0 select @CountElementsChanged += 1 select @ElementIndex += 1 end if @CountElementsChanged > 0 and exists (select top 111 1 from sys.objects o where o.name = 'QBM_PJournal' and type = 'P' ) begin select @JournalMessage = '#LDS#System elements modified by {0}, pattern {1}, elements affected {2}.|' 12 + isnull(OBJECT_NAME(@@procid), '') + '|' + @TableName + '|' + dbo.QBM_FCVIntToString(@CountElementsChanged) + '|' if not exists (select top 1 1 from 13 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 14 (readpast) on t.object_id = c.object_id where t.name = 'DialogDatabase' and c.name = 'InitialMigrationRunning' ) begin exec QBM_PJournal @JournalMessage 15, @@procid, @MessageType, @DebugLevel, 20 end else begin exec QBM_PJournal @JournalMessage, @@procid, 'I', 'I' end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd 16 default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 17
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.150
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 |
|---|---|---|
@TableName | nvarchar(64) | 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: @TableName @SQLcmd @TabAktuell @elements @ElementCount @ElementIndex @JournalMessage @DebugLevel @MessageType @CountElementsChanged @SQL @ROWCOUNT @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @HandleErrorSilent @ExecuteWithTransact @procid @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_ZConstraintDisable | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_ZConstraintDisable | source text reference | has TRY/CATCH error handling |