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.
Parameters
| Name | Type | Output |
|---|---|---|
@WithoutPKCorrection | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| dialogcolumn | OBJECT_OR_COLUMN | ||
| DialogTable | OBJECT_OR_COLUMN | ||
| QBM_PColumnSchemaDataTypeCorr | OBJECT_OR_COLUMN | ||
| QBM_PDialogTablePKNameCorrect | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_PTableRevisionFill | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVElementToObjectKey1 | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVSchemaDatatypeToIntern | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN | |
| dbo | QBM_FTPrimaryKeyInfo_BTVP | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
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
| Parameter | Type | Direction |
|---|---|---|
@WithoutPKCorrection | bit | input |
DML targets
UPDATE DialogTable UPDATE dialogcolumn UPDATE DialogColumnCalled routines
Read/join references
SQL dependency metadata
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 object | Relation | Evidence |
|---|---|---|
| dbo.QBM_PCustomSQLPropagate | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PDatabasePrepare | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PDatabasePrepareCheck2 | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_PCustomSQLPropagate | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PDatabasePrepare | source text reference | has TRY/CATCH error handling |
| dbo.QBM_PDatabasePrepareCheck2 | source text reference | has TRY/CATCH error handling |