dbo.QBM_TUDialogDatabase
SQL_TRIGGER parent DialogDatabase
Created 2025-06-27T18:01:01.300 · modified 2026-04-14T23:23:08.067 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| No parameters. | ||
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| deleted | OBJECT_OR_COLUMN | ||
| DialogConfigParm | OBJECT_OR_COLUMN | ||
| DialogDatabase | OBJECT_OR_COLUMN | ||
| inserted | OBJECT_OR_COLUMN | ||
| QBM_PDBQueueInsert_Single | OBJECT_OR_COLUMN | ||
| QBM_PSessionContextSet | OBJECT_OR_COLUMN | ||
| QBM_PSessionErrorAdd | OBJECT_OR_COLUMN | ||
| dbo | QBM_FGISessionContext | OBJECT_OR_COLUMN | |
| dbo | QBM_FGISessionErrorRethrow | OBJECT_OR_COLUMN | |
| dbo | QBM_FGIUserAccessLevel | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create trigger QBM_TUDialogDatabase on DialogDatabase for Update not for Replication as begin SET XACT_ABORT OFF declare @NewProductionlevel 2 int declare @ErrorMessage nvarchar(1000) BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top 1 1 from deleted) goto start 3 return start: if not dbo.QBM_FGIUserAccessLevel() > 3 and not (update(FESimulationStarted) or update(XUserUpdated) or update(XDateUpdated) ) begin raiserror 4 ('#LDS#Access denied with AccessLevel <= 3|', 18, 1) with nowait end declare @GenProcID varchar(38) select @GenProcID = dbo.QBM_FGISessionContext('') 5if update(ProductionLevel) begin select @NewProductionlevel = null select top 1 @NewProductionlevel = db.ProductionLevel from DialogDatabase db join deleted 6 d on db.UID_Database = d.UID_Database where db.IsMainDatabase = 1 and isnull(db.ProductionLevel, 0) <> isnull(d.ProductionLevel, 0) if @NewProductionlevel 7 > ' ' begin update DialogConfigParm set Value = case @NewProductionlevel when 0 then 5 when 1 then 7 else 0 end where FullPath = 'QBM\DBQueue\CountSlotsMax' 8 update DialogConfigParm set Value = case @NewProductionlevel when 0 then 20 when 1 then 40 else 120 end where FullPath = 'QBM\DBQueue\KeepAlive' end 9 end if UPDATE(DataOrigin) begin exec QBM_PDBQueueInsert_Single 'QBM-K-GetServerProperties', '', '', @GenProcID end if update(UID_CutOffTask) begin if 10(select top 1 i.UID_CutOffTask from inserted i ) is null begin exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end else begin if exists (select 11 top 1 1 from deleted d join DialogDatabase i on d.UID_Database = i.UID_Database where i.UID_CutOffTask in ('QBM-K-CommonWaitForCompiler', 'QBM-K-BaseMigrationReady' 12) and (d.UID_CutOffTask is null or i.UID_CutOffTask = d.UID_CutOffTask ) ) begin exec QBM_PSessionContextSet 'INSERTEDINTODBQUEUE', '1' end else begin 13 select top 1 @ErrorMessage = concat('#LDS#Invalid Update in column UID_CutOffTask. Old task: {0}, New task {1}.|' , isnull(d.UID_CutOffTask, '<empty>' 14), '|' , isnull(i.UID_CutOffTask, '<empty>'), '|' ) from deleted d join DialogDatabase i on d.UID_Database = i.UID_Database where i.IsMainDatabase = 1 15if @@TRANCOUNT > 0 begin rollback end raiserror (@ErrorMessage, 18, 1) with nowait end end end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default declare 16 @Rethrow varchar(1000) = dbo.QBM_FGISessionErrorRethrow() RAISERROR (@Rethrow, 18, 1) WITH NOWAIT END CATCH end 17
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:23:08.067
inserts DBQueue tasks uses session context values has TRY/CATCH error handling
Summary: calls QBM_PDBQueueInsert_Single, QBM_PSessionContextSet, QBM_PSessionErrorAdd; writes UPDATE not, UPDATE DialogConfigParm, UPDATE in; reads/joins inserted, deleted, DialogDatabase; uses config QBM\DBQueue\CountSlotsMax, QBM\DBQueue\KeepAlive; uses session context INSERTEDINTODBQUEUE
Declared parameters
No declared parameters in sys.parameters for this object, or metadata was not available.
DML targets
UPDATE not UPDATE DialogConfigParm UPDATE inRead/join references
SQL dependency metadata
Config/session
Config: QBM\DBQueue\CountSlotsMax QBM\DBQueue\KeepAlive
Session: INSERTEDINTODBQUEUE
DBQueue/tasks
QBM-K-GetServerProperties QBM-K-CommonWaitForCompiler QBM-K-BaseMigrationReadyTemp tables / referenced variables
Temp: #LDS #Access #Invalid
Variables: @NewProductionlevel @ErrorMessage @GenProcID @TRANCOUNT @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.