dbo.QBM_ZPrepropGenerateFunction

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@SlotNumberDummyintno
@dummy1varcharno
@dummy2varcharno
@dummyGenProcIDvarcharno

Referenced objects

SchemaObjectColumn/minorClass
DialogColumnOBJECT_OR_COLUMN
dialogConfigparmOBJECT_OR_COLUMN
dialogConfigparmOptionOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
QBM_PDBQueueInsert_SingleOBJECT_OR_COLUMN
QBM_PExecuteSQLWithRetry_LLPOBJECT_OR_COLUMN
QBM_PPrePropCheckExpressionOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBM_YParameterListTYPE
dboQBM_FGIDBOwnerOBJECT_OR_COLUMN
dboQBM_FSQRemoveComment_iOBJECT_OR_COLUMN
dboQBM_FSQStringAsLiteralOBJECT_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_ZPrepropGenerateFunction (@SlotNumberDummy int , @dummy1 varchar(38) , @dummy2 varchar(38) , @dummyGenProcID varchar(38
2) ) as begin declare @Props QBM_YParameterList declare @Preproperfuellt nvarchar(max)  declare @tablename varchar(30) declare @Query nvarchar(max) = 'select '''' as Condition'
3 declare @PreProcessorCondition nvarchar(max) declare @IsDeactivated bit declare @FunctionName varchar(30) = 'QBM_FGIPrepropConditionDeactiv' declare @FunctionBody
4 nvarchar(max) = '
5create or alter function dbo.' + @FunctionName + '  (@PreProcessorCondition nvarchar(max)
6													)
7	returns bit
8 with schemabinding
9 as
10 begin
11	return( case isnull(@PreProcessorCondition, '''')
12					when '''' then 0'
13 declare @DebugSwitch int = 0 declare @GenProcID varchar(38) = newid() declare @OldCode nvarchar(max) declare @ElementLast int declare @ElementBufferMulti
14 QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int BEGIN TRY select @Preproperfuellt  = string_agg(convert(nvarchar(max), N'|' + x.PreProcessorString
15 + N'|' )  , N'' )  from ( select distinct PreProcessorString from dialogConfigparm c join dialogConfigparmOption o on c.UID_ConfigParm = o.UID_ConfigParm
16 and c.value = o.OptionValue where c.isenabledResulting = 1 and o.PreProcessorString > ' ' and c.IsPreprocessorCondition = 1 ) as x if @DebugSwitch > 0
17 begin print '@Preproperfuellt ' + @Preproperfuellt end  select @Query = 'select '''' as Condition union ' + string_agg( convert(nvarchar(max), concat(
18N'select isnull(PreProcessorCondition, '''')  from ' , t.TableName , nchar(13) , nchar(10) ) )  , concat(' union ' , nchar(13) , nchar(10)) )   from DialogColumn
19 c join DialogTable t on c.UID_DialogTable = t.UID_DialogTable where c.ColumnName = 'PreProcessorCondition' if @DebugSwitch > 0 begin print @query end 
20insert into @Props(ContentFull) exec sp_executesql @query if @DebugSwitch > 0 begin print 'select ContentFull from @Props' select ContentFull from @Props
21 end   delete  @ElementBufferMulti  insert into @ElementBufferMulti (ContentFull) select p.ContentFull from @Props p where p.ContentFull > ' ' order by
22 p.ContentFull desc select @ElementCount = @@ROWCOUNT select @ElementIndex = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY while @ElementIndex
23 <= @ElementLast begin if @DebugSwitch > 0 begin print '@ElementIndex ' + str(@ElementIndex) end select top 1 @PreProcessorCondition = bu.ContentFull from
24 @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex exec @IsDeactivated = QBM_PPrePropCheckExpression @PreProcessorCondition, @Preproperfuellt
25 select @IsDeactivated = @IsDeactivated ^1 if @DebugSwitch > 0 begin print str(@IsDeactivated) + '#' + @PreProcessorCondition end select @FunctionBody 
26= @FunctionBody + '
27					when ' + dbo.QBM_FSQStringAsLiteral(@PreProcessorCondition, 0, 0) + ' then ' + str(@IsDeactivated) select @ElementIndex += 1 
28end  select @FunctionBody = @FunctionBody + + '
29					else 1
30			 end
31		) 
32end
33'   select @oldcode = null select top 1 @OldCode = m.definition from 
34sys.objects f join sys.sql_modules m on f.object_id = m.object_id where f.name = @FunctionName if @oldcode is null begin select @oldcode = '' end select
35 @OldCode = replace(@OldCode, 'create   function', 'create or alter function')  if dbo.QBM_FGIDBOwner() = 'CCC' begin select @FunctionBody = dbo.QBM_FSQRemoveComment_i
36(@FunctionBody, 1) end exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @FunctionBody , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , 
37@ProcIDForJournal = default , @HandleErrorSilent = 0 if trim(dbo.QBM_FSQRemoveComment_i(@FunctionBody, 1)) <> trim(dbo.QBM_FSQRemoveComment_i(@OldCode,
38 1)) begin if @DebugSwitch > 0 begin print '#### is different'             end exec QBM_PDBQueueInsert_Single 'QBM-K-PrepropAll' , '', '', @GenProcID end
39 END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH ende: return end 
40

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

inserts DBQueue tasks has TRY/CATCH error handling

Summary: calls QBM_PPrePropCheckExpression, QBM_PExecuteSQLWithRetry_LLP, QBM_PDBQueueInsert_Single, QBM_PSessionErrorAdd; writes INSERT into; reads/joins dialogConfigparm, dialogConfigparmOption, DialogColumn, DialogTable, sys

Declared parameters

ParameterTypeDirection
@SlotNumberDummyintinput
@dummy1varchar(38)input
@dummy2varchar(38)input
@dummyGenProcIDvarchar(38)input

DML targets

INSERT into

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

QBM-K-PrepropAll

Temp tables / referenced variables

Temp: None extracted.

Variables: @SlotNumberDummy @dummy1 @dummy2 @dummyGenProcID @Props @Preproperfuellt @tablename @Query @PreProcessorCondition @IsDeactivated @FunctionName @FunctionBody @DebugSwitch @GenProcID @OldCode @ElementLast @ElementBufferMulti @ElementCount @ElementIndex @query @ROWCOUNT @IDENTITY @oldcode @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.