dbo.QBM_PDatabasePrepareCheck1

SQL_STORED_PROCEDURE

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

Open formatted source/search result

Parameters

NameTypeOutput
@WithoutPKCorrectionbitno

Referenced objects

SchemaObjectColumn/minorClass
dialogcolumnOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
QBM_PColumnSchemaDataTypeCorrOBJECT_OR_COLUMN
QBM_PDialogTablePKNameCorrectOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_PTableRevisionFillOBJECT_OR_COLUMN
dboQBM_FCVElementToObjectKey1OBJECT_OR_COLUMN
dboQBM_FCVSchemaDatatypeToInternOBJECT_OR_COLUMN
dboQBM_FGISessionErrorRethrowOBJECT_OR_COLUMN
dboQBM_FTPrimaryKeyInfo_BTVPOBJECT_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_PDatabasePrepareCheck1 (@WithoutPKCorrection bit = 0 ) as begin declare @XUser nvarchar(64) = object_name(@@procid) declare
2 @Xdate datetime = getutcdate() SET XACT_ABORT OFF BEGIN TRY set nocount on update DialogTable set XObjectKey = dbo.QBM_FCVElementToObjectKey1('DialogTable'
3, 'uid_Dialogtable', uid_Dialogtable)  , XDateUpdated = @Xdate , XUserUpdated = @XUser where XObjectKey <> dbo.QBM_FCVElementToObjectKey1('DialogTable'
4, 'uid_Dialogtable', uid_Dialogtable)  exec QBM_PColumnSchemaDataTypeCorr '%'  update dialogcolumn set Datatype = dbo.QBM_FCVSchemaDatatypeToIntern(c.SchemaDataType
5, c.SchemaDatalen)  , XDateUpdated = @Xdate , XUserUpdated = @XUser from DialogColumn c join DialogTable t with (readpast) on c.UID_DialogTable = t.UID_DialogTable
6 where c.Datatype <> dbo.QBM_FCVSchemaDatatypeToIntern(c.SchemaDataType, c.SchemaDatalen) and t.TableType in ('B', 'T', 'M') update dialogcolumn set Datatype
7 = dbo.QBM_FCVSchemaDatatypeToIntern(c.SchemaDataType, c.SchemaDatalen)   , XDateUpdated = @Xdate , XUserUpdated = @XUser from DialogColumn c join DialogTable
8 t with (readpast) on c.UID_DialogTable = t.UID_DialogTable where c.Datatype <> dbo.QBM_FCVSchemaDatatypeToIntern(c.SchemaDataType, c.SchemaDatalen) and
9 t.TableType in ('R', 'U'  , 'P' ) update dialogcolumn set datatype = x.datatype   , XDateUpdated = @Xdate , XUserUpdated = @XUser from dialogcolumn , 
10dialogcolumn x, DialogTable t with (readpast) where dialogcolumn.UID_BaseColumn = x.uid_dialogcolumn and dialogColumn.UID_DialogTable = t.UID_DialogTable
11 and t.tabletype = 'V' and isnull(dialogcolumn.Datatype, -1) <> x.Datatype   update DialogColumn set IsUID = 1  , XDateUpdated = @Xdate , XUserUpdated 
12= @XUser where SchemaDataType = 'varchar' and SchemaDataLen = 38 and IsUID = 0 update DialogColumn set IsUID = 0  , XDateUpdated = @Xdate , XUserUpdated
13 = @XUser where (SchemaDataType <> 'varchar' or SchemaDataLen <> 38 ) and IsUID = 1 if @WithoutPKCorrection = 1 begin goto EndLabel end update DialogColumn
14 set IsPKMember = v.IsPKMember  , XDateUpdated = @Xdate , XUserUpdated = @XUser  from DialogColumn c join dbo.QBM_FTPrimaryKeyInfo_BTVP() v on c.UID_DialogColumn
15 = v.UID_DialogColumn where c.IsPKMember <> v.IsPKMember and v.TableType not in ('U', 'R')     exec QBM_PDialogTablePKNameCorrect '%'  update dialogcolumn
16 set XObjectKey = dbo.QBM_FCVElementToObjectKey1('DialogColumn', 'uid_dialogcolumn', uid_dialogcolumn)  , XDateUpdated = @Xdate , XUserUpdated = @XUser
17 where XObjectKey <> dbo.QBM_FCVElementToObjectKey1('DialogColumn', 'uid_dialogcolumn', uid_dialogcolumn) exec QBM_PTableRevisionFill END TRY BEGIN CATCH
18 exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH 
19endLabel: return end 
20

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

has TRY/CATCH error handling

Summary: calls QBM_PColumnSchemaDataTypeCorr, QBM_PDialogTablePKNameCorrect, QBM_PTableRevisionFill, QBM_PSessionErrorAdd; writes UPDATE DialogTable, UPDATE dialogcolumn, UPDATE DialogColumn; reads/joins DialogColumn, DialogTable, dialogcolumn, QBM_FTPrimaryKeyInfo_BTVP

Declared parameters

ParameterTypeDirection
@WithoutPKCorrectionbitinput

DML targets

UPDATE DialogTable UPDATE dialogcolumn UPDATE DialogColumn

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @WithoutPKCorrection @XUser @procid @Xdate @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_PCustomSQLPropagateSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PDatabasePrepareSQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PDatabasePrepareCheck2SQL expression dependencyOBJECT_OR_COLUMN
dbo.QBM_PCustomSQLPropagatesource text referencehas TRY/CATCH error handling
dbo.QBM_PDatabasePreparesource text referencehas TRY/CATCH error handling
dbo.QBM_PDatabasePrepareCheck2source text referencehas TRY/CATCH error handling