dbo.QBM_ZObjectKeyRepair

SQL_STORED_PROCEDURE

Created 2025-06-27T17:58:58.913 · modified 2026-04-14T23:20:29.687 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberDummyintno
@TablePatternvarcharno
@Dummy2varcharno
@DummyGenProcIDvarcharno

Referenced objects

SchemaObjectColumn/minorClass
dialogcolumnOBJECT_OR_COLUMN
dialogtableOBJECT_OR_COLUMN
QBM_PExecuteSQLWithRetry_LLPOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_VHeavyLoadTablesOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
dboQBM_FGIColumnExistsInSchemaOBJECT_OR_COLUMN
dboQBM_FSQObjectKeyRepair_fn2OBJECT_OR_COLUMN

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1  create   procedure QBM_ZObjectKeyRepair ( @SlotNumberDummy int , @TablePattern varchar(38) , @Dummy2 varchar(38) , @DummyGenProcID varchar(38)
2 ) as begin declare @TableName nvarchar(64) declare @muster nvarchar(max) declare @Ruf nvarchar(max) declare @SQLcmd nvarchar(max) declare @DebugSwitch
3 int = 0 declare @ElementBuffer QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int BEGIN TRY select @muster = 'update %tabelle% 
4	set XObjectKey = %ruf% #xwerte#
5 from %tabelle% z with (readpast)
6 where z.XObjectKey  <>  %ruf% collate  SQL_Latin1_General_CP1_CS_AS'
7   insert into @ElementBuffer (Ident1) select t.TableName  from dialogcolumn c with (readpast) join dialogtable t with (readpast) on c.UID_DialogTable 
8= t.UID_DialogTable and t.tabletype in ('T', 'V')  join information_schema.tables it with (readpast) on t.TableName = it.table_name where c.isPKMember 
9= 1 and exists (select top 1 1 from dialogcolumn cc with (readpast) where cc.columnname = 'XObjectKey' and cc.UID_DialogTable = c.UID_DialogTable ) and
10 not exists (select top 1 1 from dialogtable tt with (readpast) where tt.UID_DialogTableBase = c.UID_DialogTable ) and t.TableName like @TablePattern and
11 t.TableName not in (select TableName from QBM_VHeavyLoadTables  ) and t.TableName not like '%[_]mem' group by t.TableName  having count(*) <= 2 order 
12by 1 select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @TableName = bu.Ident1 from @ElementBuffer
13 bu where bu.ElementIndex = @ElementIndex select @ruf = dbo.QBM_FSQObjectKeyRepair_fn2 (@TableName, 'z' ) select @SQLcmd = replace(@muster, N'%ruf%', @ruf
14) select @SQLcmd = replace(@SQLcmd, N'%tabelle%', @TableName ) select @SQLcmd = replace(@sqlcmd, '#xwerte#', case dbo.QBM_FGIColumnExistsInSchema(@TableName
15, 'XDateUpdated') when 1 then ', XDateUpdated = getutcdate(), XUserUpdated =  ''' + object_name(@@procid) + '''' else '' end ) if @DebugSwitch > 0 begin
16 print @SQLcmd end exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @SQLcmd , @LockTimeout_ms = 3000 , @MaxWaitTimeForLock_s = 15.0 , @ProcIDForJournal
17 = @@procid , @HandleErrorSilent = 0  select @ElementIndex += 1 end  END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT
18 END CATCH end 
19

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:29.687

has TRY/CATCH error handling

Summary: calls QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorAdd; writes INSERT into; reads/joins dialogcolumn, dialogtable, information_schema, QBM_VHeavyLoadTables

Declared parameters

ParameterTypeDirection
@SlotNumberDummyintinput
@TablePatternvarchar(38)input
@Dummy2varchar(38)input
@DummyGenProcIDvarchar(38)input

DML targets

INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: #xwerte

Variables: @SlotNumberDummy @TablePattern @Dummy2 @DummyGenProcID @TableName @muster @Ruf @SQLcmd @DebugSwitch @ElementBuffer @ElementCount @ElementIndex @ROWCOUNT @ruf @sqlcmd @procid @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @HandleErrorSilent

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.

No reverse dependencies extracted.