dbo.QBM_PViewBuildR_intern
Stored ProcedureSQL_STORED_PROCEDURESandbox DB
Interpretation
- Database routine. Review parameters, called procedures, DBQueue inserts, and QBM_PJobCreate helper calls before assuming side effects.
Relations
- No extracted relations.
Typed Edges
- references source dbo.QBM_FGISessionErrorRethrow source text reference
- references source dbo.QBM_FGITableName source text reference
- references source dbo.QBM_PDialogColumnDelete source text reference
- references source dbo.QBM_PDialogColumnInsert source text reference
- references source dbo.QBM_PSessionErrorAdd source text reference
- references source dbo.QBM_PViewBuild source text reference
- references source dbo.QBM_PViewBuild_FromAddOn source text reference
- references source dbo.QBM_PViewBuildR source text reference
- references source dbo.QBM_PViewDrop source text reference
Complete Source
1CREATE PROCEDURE QBM_PViewBuildR_intern(2 @UID_DialogTableR varchar(38),3 @GenProcID varchar(38),4 @ModuleName varchar(3) = '',5 @AutoCorrectColumns BIT = 06)7AS8BEGIN9 DECLARE @SQLcmd nvarchar(max)10 DECLARE @TableNameR varchar(38)11 DECLARE @DebugSwitch int = 012 DECLARE @DebugLevel varchar(1) = 'W'13 SET XACT_ABORT OFF14 BEGIN TRY15 SELECT @TableNameR = dbo.QBM_FGITableName(@UID_DialogTableR)16 IF EXISTS(17 SELECT TOP 1 118 FROM information_schema.tables19 WHERE20 table_name = @TableNameR AND table_type = 'VIEW') AND NOT EXISTS(21 SELECT TOP 1 122 FROM dialogtable t23 WHERE24 t.TableName = @TableNameR)25 BEGIN26 EXEC QBM_PViewDrop @TableNameR27 END28 IF NOT EXISTS(29 SELECT TOP 1 130 FROM DialogTable t31 WHERE32 t.TableName = @TableNameR AND t.TableType = 'R')33 BEGIN34 GOTO endLabel35 END36 IF NOT EXISTS(37 SELECT TOP 1 138 FROM DialogTable t39 WHERE40 t.UID_DialogTable = @UID_DialogTableR)41 BEGIN42 GOTO endLabel43 END44 IF @DebugSwitch > 045 BEGIN46 SELECT *47 FROM QBMViewAddOn48 WHERE49 UID_DialogTable = @UID_DialogTableR50 END51 EXEC QBM_PViewBuild_FromAddOn @UID_DialogTableR52 IF @AutoCorrectColumns = 153 BEGIN54 EXEC QBM_PDialogColumnDelete @TableNameR,55 @GenProcID56 EXEC QBM_PDialogColumnInsert @TableNameR,57 @GenProcID,58 @ModuleName59 END60 END TRY61 BEGIN CATCH62 EXEC QBM_PSessionErrorAdd DEFAULT63 DECLARE @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow()64 RAISERROR(@Rethrow,65 18,66 1)67 WITH NOWAIT68 END CATCH69 endLabel:70 RETURN71END
Open raw exported source
1 create procedure QBM_PViewBuildR_intern ( @UID_DialogTableR varchar(38), @GenProcID varchar(38) , @ModuleName varchar(3) = '' , @AutoCorrectColumns2 bit = 0 ) as begin declare @SQLcmd nvarchar(max) declare @TableNameR varchar(38) declare @DebugSwitch int = 0 declare @DebugLevel varchar(1) = 'W' SET3 XACT_ABORT OFF BEGIN TRY select @TableNameR = dbo.QBM_FGITableName(@UID_DialogTableR) if exists (select top 1 1 from information_schema.tables where table_name4 = @TableNameR and table_type = 'VIEW' ) and not exists (select top 1 1 from dialogtable t where t.TableName = @TableNameR ) begin exec QBM_PViewDrop @TableNameR5 end if not exists (select top 1 1 from DialogTable t where t.TableName = @TableNameR and t.TableType = 'R' ) begin goto endLabel end if not exists (select6 top 1 1 from DialogTable t where t.UID_DialogTable = @UID_DialogTableR ) begin goto endLabel end if @DebugSwitch > 0 begin select * from QBMViewAddOn 7where UID_DialogTable = @UID_DialogTableR end exec QBM_PViewBuild_FromAddOn @UID_DialogTableR if @AutoCorrectColumns = 1 begin exec QBM_PDialogColumnDelete8 @TableNameR , @GenProcID exec QBM_PDialogColumnInsert @TableNameR , @GenProcID, @ModuleName end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default 9declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return end 10