dbo.QBM_PGICountTablesUsedByCode
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:00.600 · modified 2026-04-14T23:14:10.290 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@Statements | QBM_YCursorBuffer | no |
@CodeName | varchar | no |
@CodeType | varchar | no |
@OpenParenthesis | nvarchar | no |
@CloseParenthesis | nvarchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorbuffer | TYPE | ||
| dbo | QBM_FGICountTablesUsedByCode | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | 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_PGICountTablesUsedByCode( @Statements QBM_YCursorbuffer readonly , @CodeName varchar(30) , @CodeType varchar(30) , 2@OpenParenthesis nvarchar(max) , @CloseParenthesis nvarchar(max) ) as begin declare @SQLCmd nvarchar(max) declare @ElementCount int declare @ElementIndex 3 int declare @CountRefereced int = 0 declare @DebugSwitch int = 0 SET XACT_ABORT OFF BEGIN TRY set nocount on select @ElementCount = count(*) from @Statements 4 select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select @SQLCmd = concat( 'drop ', @CodeType, ' if exists dbo.', @CodeName) exec sp_executesql 5 @SQLCmd select @SQLCmd = concat ( @OpenParenthesis, s.ContentFull , @CloseParenthesis ) from @Statements s where s.ElementIndex = @ElementIndex if @DebugSwitch 6 > 0 begin print @sqlcmd end exec sp_executesql @SQLCmd select @CountRefereced += dbo.QBM_FGICountTablesUsedByCode(@CodeName) if @DebugSwitch > 0 begin 7 print '@CountRefereced ' + str(@CountRefereced) end select @SQLCmd = concat( 'drop ', @CodeType, ' if exists dbo.', @CodeName) exec sp_executesql @SQLCmd 8 select @ElementIndex += 1 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() 9RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH endLabel: return(@CountRefereced) end 10
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.290
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@Statements | qbm_ycursorbuffer | input |
@CodeName | varchar(30) | input |
@CodeType | varchar(30) | input |
@OpenParenthesis | nvarchar | input |
@CloseParenthesis | nvarchar | input |
DML targets
None extracted.Called routines
Read/join references
None extracted.
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @Statements @CodeName @CodeType @OpenParenthesis @CloseParenthesis @SQLCmd @ElementCount @ElementIndex @CountRefereced @DebugSwitch @sqlcmd @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.ATT_ZAttHelperFillMakeProc | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_P30907EB9FB8232867B_func | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_ZPWOHelperFillMakeProc | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ATT_ZAttHelperFillMakeProc | source text reference | has TRY/CATCH error handling |
| dbo.QER_P30907EB9FB8232867B_func | source text reference | SQL_STORED_PROCEDURE |
| dbo.QER_ZPWOHelperFillMakeProc | source text reference | has TRY/CATCH error handling |