dbo.QBM_PCustomSQLCompile

SQL_STORED_PROCEDURE

Created 2025-06-27T18:01:00.653 · modified 2026-04-14T23:20:32.087 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
QBM_PCustomSQLFillOBJECT_OR_COLUMN
QBM_PExecuteSQLWithRetry_LLPOBJECT_OR_COLUMN
QBM_PJournalOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_PSessionErrorCleanOBJECT_OR_COLUMN
QBMCustomSQLOBJECT_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_PCustomSQLCompile as begin set nocount on declare @scripttype nvarchar(10) declare @scriptname nvarchar(255) declare @scriptcode
2 nvarchar(max) declare @SortOrder int declare @initialContent nvarchar(max) declare @Work table (scripttype nvarchar(10) collate database_default , scriptname
3 nvarchar(255) collate database_default , scriptcode nvarchar(max) collate database_default , SortOrder int identity ) declare @AllesSchoen bit = 1 SET
4 XACT_ABORT OFF BEGIN TRY if not exists (select top 1 1 from QBMCustomSQL ) begin exec QBM_PCustomSQLFill print 'exec QBM_PCustomSQLFill' end  begin Transaction
5 SAVE TRANSACTION CompleVersuch delete QBMCustomSQL exec QBM_PCustomSQLFill   insert into @Work(scripttype, scriptname, scriptcode) select c.scripttype
6, c.ScriptName, c.scriptcode from QBMCustomSQL c where c.ScriptType in (N'N', N'F') order by c.scripttype, c.SortOrder while exists (select top 1 1 from
7 @Work) BEGIN select top 1 @scriptname = w.scriptname , @scripttype = w.scripttype , @scriptcode = w.scriptcode , @SortOrder = w.SortOrder from @Work w
8 order by w.SortOrder select @initialContent = N'drop function if exists ' + rtrim(@ScriptName) exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @initialContent
9 , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = @@procid , @HandleErrorSilent = 0  BEGIN TRY exec QBM_PExecuteSQLWithRetry_LLP
10 @SQLStatement = @scriptcode , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = @@procid , @HandleErrorSilent = 0 exec
11 QBM_PSessionErrorClean END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default select @AllesSchoen = 0    END CATCH delete  @Work  where SortOrder = @SortOrder
12 END    delete  @Work  insert into @Work(scripttype, scriptname, scriptcode) select c.scripttype, c.ScriptName, c.scriptcode from QBMCustomSQL c where 
13c.ScriptType in (N'V', N'P', N'T') order by c.SortOrder while exists (select top 1 1 from @Work) BEGIN select top 1 @scriptname = w.scriptname , @scripttype
14 = w.scripttype , @scriptcode = w.scriptcode , @SortOrder = w.SortOrder from @Work w order by w.SortOrder select @initialContent = concat('exec ' , case
15 @Scripttype when 'V' then 'QBM_PViewDrop ' when 'T' then 'QBM_PTriggerDrop ' else 'QBM_PProcedureDrop ' end , '''', rtrim(@ScriptName), '''' , case @scripttype
16 when 'T' then ' , @CustomTriggerAlso = 1' else '' end ) exec QBM_PJournal 'Element Zwangsweise gedroppt in CustomSQLCompile', @@PROCID, 'E', 'E' exec 
17QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @initialContent , @LockTimeout_ms = default , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = @@procid
18 , @HandleErrorSilent = 0  exec QBM_PSessionErrorClean BEGIN TRY exec QBM_PExecuteSQLWithRetry_LLP @SQLStatement = @scriptcode , @LockTimeout_ms = default
19 , @MaxWaitTimeForLock_s = default , @ProcIDForJournal = @@procid , @HandleErrorSilent = 0 exec QBM_PSessionErrorClean END TRY BEGIN CATCH exec QBM_PSessionErrorAdd
20 default select @AllesSchoen = 0    END CATCH delete  @Work  where SortOrder = @SortOrder END  ROLLBACK TRANSACTION CompleVersuch Commit Transaction  if
21 @AllesSchoen = 0 begin  RAISERROR ('', 18, 1) WITH NOWAIT end END TRY BEGIN CATCH declare @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR
22 (@Rethrow, 18, 1) WITH NOWAIT END CATCH ende:  return end 
23

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

has TRY/CATCH error handling

Summary: calls QBM_PCustomSQLFill, QBM_PExecuteSQLWithRetry_LLP, QBM_PSessionErrorClean, QBM_PSessionErrorAdd, QBM_PJournal; writes INSERT into, DELETE QBMCustomSQL; reads/joins QBMCustomSQL

Declared parameters

No declared parameters in sys.parameters for this object, or metadata was not available.

DML targets

INSERT into DELETE QBMCustomSQL

Read/join references

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

None extracted.

Temp tables / referenced variables

Temp: None extracted.

Variables: @scripttype @scriptname @scriptcode @SortOrder @initialContent @Work @AllesSchoen @ScriptName @SQLStatement @LockTimeout_ms @MaxWaitTimeForLock_s @ProcIDForJournal @procid @HandleErrorSilent @Scripttype @CustomTriggerAlso @PROCID @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.