dbo.QBM_PTableAdd

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@TableNamevarcharno
@CreateStmtnvarcharno
@UID_DialogTablevarcharno
@TableTypenvarcharno

Referenced objects

SchemaObjectColumn/minorClass
DialogTableOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_YCursorBufferTYPE
dboQBM_FCVGUIDToModuleOwnerOBJECT_OR_COLUMN
dboQBM_FGIDBOwnerOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_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_PTableAdd (@TableName varchar(30) , @CreateStmt nvarchar(max) , @UID_DialogTable varchar(38) = null , @TableType nvarchar
2(1) = 'T' ) as begin declare @OwnerDB varchar(3) declare @OwnerTable varchar(3) declare @ElementsToKeep int declare @ViewsWithElementsToKeep QBM_YCursorBuffer
3 declare @ViewName varchar(30) declare @ElementLast int declare @ElementCount int declare @ElementIndex int declare @cmd nvarchar(max) declare @XUser nvarchar
4(64) = object_name(@@procid) declare @Xdate datetime = getutcdate() SET XACT_ABORT OFF BEGIN TRY if not exists (select top 1 1 from sys.tables t where 
5t.name = @TableName ) begin exec sp_executesql @CreateStmt end if @UID_DialogTable is null begin goto endLabel  end if not exists (select top 1 1 from 
6sys.tables t where t.name = 'DialogTable' ) begin goto endLabel end   select @OwnerDB = dbo.QBM_FGIDBOwner() select @OwnerTable = dbo.QBM_FCVGUIDToModuleOwner
7(@UID_DialogTable) select @cmd = 'select name from sys.views where name like ''___[_]VElementsToKeep''' insert into @ViewsWithElementsToKeep (ObjectKey1
8) exec sp_executesql @cmd select @ElementCount = @@ROWCOUNT select @ElementIndex = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY select
9 @ElementsToKeep = 0 while @ElementIndex <= @ElementLast and @ElementsToKeep = 0 begin select top 1 @ViewName = v.ObjectKey1 from @ViewsWithElementsToKeep
10 v where v.ElementIndex = @ElementIndex select @ElementsToKeep = 0 select @cmd = 'select top 1 1 from ' + @ViewName + ' where SourceModule = ''' + @OwnerTable
11 + '''' exec sp_executesql @cmd select @ElementsToKeep = @@ROWCOUNT select @ElementIndex += 1 end if @OwnerTable <> 'CCC' and @OwnerTable <> @OwnerDB and
12 @ElementsToKeep = 0 begin  goto EndLabel end if not exists (select top 1 1 from DialogTable t where t.UID_DialogTable = @UID_DialogTable ) begin insert
13 into DialogTable( TableName, UID_DialogTable, TableType, XObjectKey , XDateInserted, XDateUpdated, XUserInserted, XUserUpdated ) values ( @TableName, 
14@UID_DialogTable, @TableType, '<Key><T>DialogTable</T><P>' + @UID_DialogTable + '</P></Key>' , @Xdate, @Xdate, @XUser, @XUser ) end END TRY BEGIN CATCH
15 exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH 
16endLabel: return end 
17

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:14:10.260

has TRY/CATCH error handling

Summary: calls QBM_PSessionErrorAdd; writes INSERT into, INSERT DialogTable; reads/joins sys, DialogTable

Declared parameters

ParameterTypeDirection
@TableNamevarchar(30)input
@CreateStmtnvarcharinput
@UID_DialogTablevarchar(38)input
@TableTypenvarchar(1)input

DML targets

INSERT into INSERT DialogTable

Called routines

Read/join references

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @TableName @CreateStmt @UID_DialogTable @TableType @OwnerDB @OwnerTable @ElementsToKeep @ViewsWithElementsToKeep @ViewName @ElementLast @ElementCount @ElementIndex @cmd @XUser @procid @Xdate @ROWCOUNT @IDENTITY @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.

No reverse dependencies extracted.