dbo.QBM_PViewBuildP_intern

SQL_STORED_PROCEDURE

Created 2025-06-27T17:57:29.897 · modified 2026-04-14T23:20:27.110 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
@UID_DialogTablePvarcharno
@GenProcIDvarcharno
@ModuleNamevarcharno
@AutoCorrectColumnsbitno

Referenced objects

SchemaObjectColumn/minorClass
DialogColumnOBJECT_OR_COLUMN
dialogtableOBJECT_OR_COLUMN
QBM_PDialogColumnDeleteOBJECT_OR_COLUMN
QBM_PDialogColumnInsertOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_PViewBuild_FromAddOnOBJECT_OR_COLUMN
QBM_PViewDropOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
QBMViewAddOnOBJECT_OR_COLUMN
dboQBM_FCVElementToObjectKey1OBJECT_OR_COLUMN
dboQBM_FCVGuidToTransferOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_OR_COLUMN
dboQBM_FGITableNameOBJECT_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_PViewBuildP_intern ( @UID_DialogTableP varchar(38), @GenProcID varchar(38) , @ModuleName varchar(3) = '' , @AutoCorrectColumns
2 bit = 0 ) as begin declare @SQLcmd nvarchar(max) declare @queryAdd nvarchar(max) declare @UID_TableBase varchar(38) declare @TableNameBase varchar(30)
3 declare @QueryWork nvarchar(max) declare @UID_QBMViewAddOn varchar(38) declare @Ident_QBMViewAddOn nvarchar(64) declare @TableNameP varchar(30) declare
4 @DebugSwitch int = 0 declare @WhereClauseExcludeTable nvarchar(max) declare @DebugLevel varchar(1) = 'W' declare @ElementLast int declare @ElementBufferMulti
5 QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int SET XACT_ABORT OFF BEGIN TRY select @TableNameP = dbo.QBM_FGITableName(@UID_DialogTableP
6) IF @DebugSwitch > 0 begin print '@TableNameP ' + @TableNameP end if exists (select top 1 1 from information_schema.tables where table_name = @TableNameP
7 and table_type = 'VIEW' ) and not exists (select top 1 1 from dialogtable t where t.TableName = @TableNameP ) begin exec QBM_PViewDrop @TableNameP end
8 if not exists (select top 1 1 from DialogTable t where t.TableName = @TableNameP and t.TableType = 'P' ) begin goto endLabel end  if not exists (select
9 top 1 1 from DialogTable t where t.UID_DialogTable = @UID_DialogTableP )  or not exists (select top 1 1 from DialogTable t where t.UID_DialogTableUnion
10 = @UID_DialogTableP ) begin goto endLabel end delete QBMViewAddOn where uid_Dialogtable = @UID_DialogTableP and IsGenerated = 1   insert into @ElementBufferMulti
11 (UID1  , Ident1  , ContentFull, ContentShort) select t.UID_DialogTable, t.TableName, t.ExtensionForProxyTable  , case t.IsDeactivatedByPreprocessor when
12 1 then ' where ( 1= 0) -- table deactivated ' else '' end as WhereClauseExcludeTable from DialogTable t where t.UID_DialogTableUnion = @UID_DialogTableP
13 select @ElementCount = @@ROWCOUNT select @ElementIndex = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY while @ElementIndex <= @ElementLast
14 begin select top 1 @UID_TableBase = bu.UID1 , @TableNameBase = bu.Ident1 , @queryAdd = bu.ContentFull , @WhereClauseExcludeTable = bu.ContentShort from
15 @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex select @Ident_QBMViewAddOn = left(concat( @TableNameP , ' : ' , @TableNameBase ) , 64) if
16 @DebugSwitch > 0 begin print '@UID_TableBase ' + @UID_TableBase end select @QueryWork = string_agg( convert(nvarchar(max), b.ColumnName + ' as ' + p.ColumnName
17 )  , N', ' )  from DialogColumn b with (readpast) join DialogColumn p with (readpast) on b.UID_DialogColumnUnionView = p.UID_DialogColumn where b.UID_DialogTable
18 = @UID_TableBase  and p.UID_DialogTable = @UID_DialogTableP if @queryAdd > ' ' begin select @QueryWork = @QueryWork + ', ' + @queryAdd end if @DebugSwitch
19 > 0 begin print 'len @QueryWork ' + str(len(@QueryWork)) print '@QueryWork ' + @QueryWork + '#' end  if @QueryWork > ' ' begin select @QueryWork = concat
20('select ' , @QueryWork, '
21					from ' , @TableNameBase , '
22					' , @WhereClauseExcludeTable )   select @UID_QBMViewAddOn = dbo.QBM_FCVGuidToTransfer
23( NEWID(), 'ZZZ') insert into QBMViewAddOn ( UID_QBMViewAddOn, UID_DialogTable, QueryString , Ident_QBMViewAddOn , IsGenerated , XDateInserted, XDateUpdated
24, XUserInserted, XUserUpdated , XObjectKey ) select @UID_QBMViewAddOn, @UID_DialogTableP, @QueryWork , @Ident_QBMViewAddOn , 1  , GETUTCDATE(), GETUTCDATE
25(), OBJECT_NAME(@@PROCID), OBJECT_NAME(@@PROCID) , dbo.QBM_FCVElementToObjectKey1('QBMViewAddOn', 'UID_QBMViewAddOn', @UID_QBMViewAddOn) end  else begin
26 if @DebugSwitch > 0 begin print 'Tabelle ohne aufzubauende Spalten ' + @UID_TableBase end end select @ElementIndex += 1 end  if @DebugSwitch > 0 begin
27 select * from QBMViewAddOn where UID_DialogTable = @UID_DialogTableP end  exec QBM_PViewBuild_FromAddOn @uid_dialogtableP if @AutoCorrectColumns = 1 begin
28 exec QBM_PDialogColumnDelete @TableNameP , @GenProcID exec QBM_PDialogColumnInsert @TableNameP , @GenProcID, @ModuleName end END TRY BEGIN CATCH exec 
29QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel:
30 return end 
31

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

has TRY/CATCH error handling

Summary: calls QBM_PViewDrop, QBM_PViewBuild_FromAddOn, QBM_PDialogColumnDelete, QBM_PDialogColumnInsert, QBM_PSessionErrorAdd; writes INSERT into, INSERT QBMViewAddOn, DELETE QBMViewAddOn; reads/joins information_schema, dialogtable, DialogTable, DialogColumn, QBMViewAddOn

Declared parameters

ParameterTypeDirection
@UID_DialogTablePvarchar(38)input
@GenProcIDvarchar(38)input
@ModuleNamevarchar(3)input
@AutoCorrectColumnsbitinput

DML targets

INSERT into INSERT QBMViewAddOn DELETE QBMViewAddOn

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @UID_DialogTableP @GenProcID @ModuleName @AutoCorrectColumns @SQLcmd @queryAdd @UID_TableBase @TableNameBase @QueryWork @UID_QBMViewAddOn @Ident_QBMViewAddOn @TableNameP @DebugSwitch @WhereClauseExcludeTable @DebugLevel @ElementLast @ElementBufferMulti @ElementCount @ElementIndex @ROWCOUNT @IDENTITY @PROCID @uid_dialogtableP @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 objectRelationEvidence
dbo.QBM_PViewBuildPSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_ZViewBuildPSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PViewBuildPsource text referenceuses session context values, has TRY/CATCH error handling
dbo.QBM_ZViewBuildPsource text referencehas TRY/CATCH error handling