dbo.QBM_PSQLCheckExecutable
SQL_STORED_PROCEDURE
Created 2025-06-27T17:57:30.103 · modified 2026-04-14T23:20:26.950 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
@QueriesToCheck | QBM_YParameterList | no |
@RaiseError | bit | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| QBM_YCursorBuffer | TYPE | ||
| QBM_YParameterList | TYPE | ||
| 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_PSQLCheckExecutable (@QueriesToCheck QBM_YParameterList readonly , @RaiseError bit = 0 ) as begin declare @sqlcmd 2 nvarchar(max) declare @Content nvarchar(max) declare @ElementKey varchar(138) declare @DebugSwitch int = 0 declare @PatNumVarStart nvarchar(1000) = '%[^'',a-z,0-9][%]%[%][^'']%' 3 declare @p1 int declare @p2 int declare @ErrorResult QBM_YParameterList declare @Message nvarchar(4000) declare @errorsDetected int = 0 declare @ElementBuffer 4 QBM_YCursorBuffer declare @ElementCount int declare @ElementIndex int declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() SET XACT_ABORT 5 OFF BEGIN TRY set nocount on insert into @ElementBuffer (ObjectKey1, ContentFull) select a.Parameter1, N' ' + a.ContentFull + N' ' from @QueriesToCheck 6 a select @ElementCount = @@ROWCOUNT select @ElementIndex = 1 while @ElementIndex <= @ElementCount begin select top 1 @elementKey = bu.ObjectKey1 , @Content 7 = bu.ContentFull from @ElementBuffer bu where bu.ElementIndex = @ElementIndex if @DebugSwitch > 2 begin print @elementKey + ' ' + isnull(@Content, '<null>' 8) end while @Content like '%$PC(%)$%' begin m1: select @p1 = 0 select @p2 = 0 select @p1 = PATINDEX('%$PC(%', @Content) if @DebugSwitch > 0 begin print 9 @p1 end select @p2 = PATINDEX('%)$%', SUBSTRING(@Content, @p1, 65000)) if @DebugSwitch > 0 begin print @p2 end if @p1 > 0 and @p2 > 0 begin select @Content 10 = LEFT(@Content, @p1 -1 ) + '''0''' + SUBSTRING(@Content, @p1 + @p2 + 1 , 65000) if @DebugSwitch > 0 begin print @Content end end else begin goto ItsReplaced1 11 end end ItsReplaced1: if @Content like @PatNumVarStart begin if @DebugSwitch > 0 begin print '### unterdrückt für Content: ' + @content end select 12 @Content = '' end if trim(@Content) = '0' or trim(@Content) = '' begin if @DebugSwitch > 0 begin print '--- nur null -- ' + @elementKey + '#' + @content+ 13 '#' end select @sqlcmd = '' end else begin if @DebugSwitch > 0 begin print '--- war mehr -- ' + @elementKey + '#' + @content+ '#' end select @sqlcmd = 14 ' 15 -- #33934 16 declare @ObjectKeys QBM_YParameterList 17 declare @erg int 18 select top 1 @erg = 1 from 19 ( ' + @Content + ' 20 ) as x 21 where 1 = 0 22 ' 23 end if @DebugSwitch = 2 begin print @sqlcmd end begin TRY if @sqlcmd > ' ' begin exec sp_executesql @sqlcmd end end try begin catch select @Message = 24concat('SyntaxError in Element ' , @ElementKey ) exec QBM_PSessionErrorAdd default, @Message if @RaiseError = 1 begin set XACT_ABORT ON RAISERROR (@Rethrow 25, 18, 1) WITH NOWAIT end else begin insert into @ErrorResult(Parameter1, ContentShort, ContentFull) select @elementKey, LEFT(@sqlcmd, 400), @Message select 26 @errorsDetected += 1 end end catch select @ElementIndex += 1 end END TRY BEGIN CATCH if @DebugSwitch > 0 begin print @sqlcmd end select @Message = (concat 27('SyntaxError in Element ' , isnull(@ElementKey, '<none>') ) ) exec QBM_PSessionErrorAdd default, @Message RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END 28CATCH endLabel: if @errorsDetected > 0 begin select Parameter1 as ElementKey, ContentShort SQLCode, ContentFull as Errormessage from @ErrorResult end 29return end 30
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.950
has TRY/CATCH error handling
Summary: calls QBM_PSessionErrorAdd; writes INSERT into
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
@QueriesToCheck | qbm_yparameterlist | input |
@RaiseError | bit | input |
DML targets
INSERT intoCalled 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: @QueriesToCheck @RaiseError @sqlcmd @Content @ElementKey @DebugSwitch @PatNumVarStart @p1 @p2 @ErrorResult @Message @errorsDetected @ElementBuffer @ElementCount @ElementIndex @Rethrow @ROWCOUNT @elementKey @content @ObjectKeys @erg
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_TIAttestationPolicy | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ATT_TUAttestationPolicy | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.CPL_TIComplianceRule | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.CPL_TIComplianceSubRule | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.CPL_TUComplianceRule | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.CPL_TUComplianceSubRule | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.DPR_TIDPRNameSpaceHasDialogTab | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.DPR_TUDPRNameSpaceHasDialogTab | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.POL_TIQERPolicy | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.POL_TUQERPolicy | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIDialogDashBoardDef | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIDialogObject | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIDialogParameter | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIDialogTable | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIJobAutoStart | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIQBMCEFDefinition | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TIQBMViewAddOn | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUDialogDashBoardDef | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUDialogObject | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUDialogParameter | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUDialogTable | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUJobAutoStart | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUQBMCEFDefinition | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QBM_TUQBMViewAddOn | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TIDynamicGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TIPWODecisionRuleRulerDete | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TIQEREntitlementSource | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TIQERRiskIndex | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUDynamicGroup | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUPWODecisionRuleRulerDete | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQEREntitlementSource | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.QER_TUQERRiskIndex | SQL expression dependency | OBJECT_OR_COLUMN |
| dbo.ATT_TIAttestationPolicy | source text reference | uses session context values, has TRY/CATCH error handling |
| dbo.ATT_TUAttestationPolicy | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.CPL_TIComplianceRule | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.CPL_TIComplianceSubRule | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.CPL_TUComplianceRule | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.CPL_TUComplianceSubRule | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.DPR_TIDPRNameSpaceHasDialogTab | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.DPR_TUDPRNameSpaceHasDialogTab | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.POL_TIQERPolicy | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.POL_TUQERPolicy | source text reference | creates object-layer jobs via QBM_PJobCreate*, inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIDialogDashBoardDef | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIDialogObject | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIDialogParameter | source text reference | uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIDialogTable | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIJobAutoStart | source text reference | uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIQBMCEFDefinition | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TIQBMViewAddOn | source text reference | has TRY/CATCH error handling |
| dbo.QBM_TUDialogDashBoardDef | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUDialogObject | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUDialogParameter | source text reference | uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUDialogTable | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUJobAutoStart | source text reference | uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUQBMCEFDefinition | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QBM_TUQBMViewAddOn | source text reference | has TRY/CATCH error handling |
| dbo.QER_TIDynamicGroup | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TIPWODecisionRuleRulerDete | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TIQEREntitlementSource | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TIQERRiskIndex | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUDynamicGroup | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUPWODecisionRuleRulerDete | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQEREntitlementSource | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |
| dbo.QER_TUQERRiskIndex | source text reference | inserts DBQueue tasks, uses session context values, has TRY/CATCH error handling |