dbo.QBM_PViewBuildV_intern

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@UID_DialogTableVvarcharno
@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_PSQLCreateOBJECT_OR_COLUMN
QBM_PViewDropOBJECT_OR_COLUMN
QBM_VSchemaColumnsOBJECT_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_PViewBuildV_intern ( @UID_DialogTableV varchar(38), @GenProcID varchar(38) , @ModuleName varchar(3) = '' , @AutoCorrectColumns
2 bit = 0 ) as begin  declare @viewwhereclause nvarchar (max) declare @SQLcmd nvarchar(max) declare @cr nvarchar(16) = nchar(13) + nchar(10) declare @AnzahlSpalten
3 int = 0 declare @uid_dialogTableBase varchar(38) declare @basetablename varchar(39) declare @TableNameV varchar(30) declare @IsDeactivatedByPreProcessor
4 bit declare @DebugSwitch int = 0 declare @DebugLevel varchar(1) = 'W' declare @ErrorMessage nvarchar(4000) declare @ErrorSeverity int declare @ErrorState
5 int  SET XACT_ABORT OFF BEGIN TRY select top 1 @viewwhereclause = ViewWhereClause , @uid_dialogTableBase = UID_DialogTableBase , @basetablename = dbo.QBM_FGITableName
6(UID_DialogTableBase) , @IsDeactivatedByPreProcessor = t.IsDeactivatedByPreProcessor from DialogTable t with (readpast) where t.UID_DialogTable = @UID_DialogTableV
7  and exists (select top 1 1 from information_schema.tables tt where tt.table_name = dbo.QBM_FGITableName(t.UID_DialogTableBase) ) if @IsDeactivatedByPreProcessor
8 = 1 begin select @viewwhereclause = ' 1 = 0 ' end select @TableNameV = dbo.QBM_FGITableName(@UID_DialogTableV)  if @DebugSwitch > 0 begin print @viewwhereclause
9 end  if exists (select top 1 1 from information_schema.tables where table_name = @TableNameV and table_type = 'VIEW' ) and not exists (select top 1 1 
10from DialogTable t where t.TableName = @TableNameV ) begin exec QBM_PViewDrop @TableNameV end if not exists (select top 1 1 from DialogTable t where t.TableName
11 = @TableNameV and t.TableType = 'V' ) begin goto endLabel end select @SQLcmd = N'create or alter view dbo.' + @TableNameV + N' as ' + @cr + N' select '
12 + @cr select @SQLcmd = @SQLcmd + string_agg(convert(nvarchar(max), nchar(9) + b.ColumnName + N' as ' + v.ColumnName )  , N',' +nchar(13) + nchar(10) )
13  from dialogcolumn v with (readpast) join DialogColumn b with (readpast) on v.uid_basecolumn = b.uid_dialogcolumn join DialogTable tb with (readpast) 
14on b.UID_DialogTable = tb.UID_DialogTable join DialogTable tv with (readpast) on v.UID_DialogTable = tv.UID_DialogTable  join QBM_VSchemaColumns cb on 
15tb.TableName = cb.table_name and b.columnname = cb.column_name where tv.UID_DialogTable = @UID_DialogTableV  and tb.UID_DialogTable= @uid_dialogTableBase
16 select @AnzahlSpalten = @@ROWCOUNT       select @SQLcmd = concat(@SQLcmd , @cr , N' from ' , @basetablename , @cr , N' where ' , @viewwhereclause , @cr
17) if @DebugSwitch > 0 begin print @SQLcmd end if @AnzahlSpalten > 0 begin  exec QBM_PSQLCreate @TableNameV, 'V', @SQLcmd, @UnComment = 0 end else begin
18  exec QBM_PViewDrop @TableNameV end if @AutoCorrectColumns = 1 begin exec QBM_PDialogColumnDelete @TablenameV, @GenProcID exec QBM_PDialogColumnInsert
19 @TablenameV, @GenProcID, @ModuleName end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow
20() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 
21

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.073

has TRY/CATCH error handling

Summary: calls QBM_PViewDrop, QBM_PSQLCreate, QBM_PDialogColumnDelete, QBM_PDialogColumnInsert, QBM_PSessionErrorAdd; reads/joins DialogTable, information_schema, dialogcolumn, DialogColumn, QBM_VSchemaColumns

Declared parameters

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

DML targets

None extracted.

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @UID_DialogTableV @GenProcID @ModuleName @AutoCorrectColumns @viewwhereclause @SQLcmd @cr @AnzahlSpalten @uid_dialogTableBase @basetablename @TableNameV @IsDeactivatedByPreProcessor @DebugSwitch @DebugLevel @ErrorMessage @ErrorSeverity @ErrorState @ROWCOUNT @UnComment @TablenameV @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_PViewBuildVSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_ZViewBuildVSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PViewBuildVsource text referenceuses session context values, has TRY/CATCH error handling
dbo.QBM_ZViewBuildVsource text referencehas TRY/CATCH error handling