dbo.QBM_TUDialogState

SQL_TRIGGER parent DialogState

Created 2025-06-27T18:01:01.093 · modified 2026-04-14T23:23:08.163 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
No parameters.

Referenced objects

SchemaObjectColumn/minorClass
deletedOBJECT_OR_COLUMN
DialogStateOBJECT_OR_COLUMN
DialogTableOBJECT_OR_COLUMN
insertedOBJECT_OR_COLUMN
QBM_PDBQueueInsert_BulkOBJECT_OR_COLUMN
QBM_PSessionErrorAddOBJECT_OR_COLUMN
QBM_VQBMRelationOBJECT_OR_COLUMN
QBM_YDBQueueRawTYPE
dboQBM_FGISessionContextOBJECT_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

1create   trigger QBM_TUDialogState on DialogState  for Update not for Replication as begin  declare @SQLCmd nvarchar(max) declare @DebugSwitch int
2 = 0 declare @GenProcID varchar(38) = dbo.QBM_FGISessionContext('') BEGIN TRY if exists (select top 1 1 from inserted) goto start if exists (select top
3 1 1 from deleted) goto start return start:  if UPDATE(IsInUse) begin if exists (select top 1 1 from deleted d join DialogState x on d.UID_DialogState 
4= x.UID_DialogState where d.IsInUse = 1 and x.IsInUse = 0 ) begin   drop table if exists #Verwaltungseinheit create table #Verwaltungseinheit(UID_PK varchar
5(38) collate database_default)  insert into #Verwaltungseinheit(UID_PK) select d.UID_DialogState from deleted d join DialogState x on d.UID_DialogState
6 = x.UID_DialogState where d.IsInUse = 1 and x.IsInUse = 0  select top 1 @SQLCmd = CONCAT( 'declare @ElemKey varchar(138) = null
7					declare @Message nvarchar(1000)
8					'
9 , string_agg( convert(nvarchar(max), CONCAT(N'
10					select @ElemKey = null
11					select top 1 @ElemKey = x.XObjectKey
12					from ', r.ChildTable , ' x join #Verwaltungseinheit y on x.'
13, r.ChildColumn ,' = y.UID_PK
14					if @ElemKey > '' ''
15					 begin
16						select @Message = CONCAT( ''#LDS#Changes cannot take place because assignments still exist. Table: {0} Element: {1}.|'' , '''
17, r.ChildTable , ''' , ''|'' , @ElemKey , ''|'' )
18						raiserror( @message, 18, 2) with nowait
19					 end
20					 ' ))  , convert(nvarchar(10), NCHAR(13
21) + nchar(10)) )  )  from QBM_VQBMRelation r join DialogTable t on r.UID_DialogTableChild = t.UID_DialogTable where r.ParentTable = 'DialogState' and t.TableType
22 in ('B', 'T') and r.IsMNRelation = 0 and t.IsMAllTable = 0  and r.ChildTable not in ('UCIUser'  , 'DialogStateHoliday' )  if @DebugSwitch > 0 begin print
23 @SQLCmd end exec sp_executesql @SQLCmd end  end   if UPDATE(IsInUse) or UPDATE(UID_DialogCountry) begin declare @DBQueueElements_01 QBM_YDBQueueRaw insert
24 into @DBQueueElements_01 (Object, SubObject, GenProcID) select x.uid, null, @GenProcID from (select i.UID_DialogState as uid from DialogState i join deleted
25 d on i.UID_DialogState = d.UID_DialogState where isnull(i.IsInUse, 0) <> isnull(d.IsInUse, 0) or isnull(i.UID_DialogCountry, '') <> isnull(d.UID_DialogCountry
26, '') ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonStateUTCOffset2', @DBQueueElements_01 exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonStateUTCOffset',
27 @DBQueueElements_01 end if UPDATE(IsInUse) or UPDATE(UID_DialogCountry) begin declare @DBQueueElements_02 QBM_YDBQueueRaw insert into @DBQueueElements_02
28 (Object, SubObject, GenProcID) select x.uid, null, @GenProcID from (select i.UID_DialogCountry as uid from DialogState i join deleted d on i.UID_DialogState
29 = d.UID_DialogState where isnull(i.IsInUse, 0) <> isnull(d.IsInUse, 0) or isnull(i.UID_DialogCountry, '') <> isnull(d.UID_DialogCountry, '') union select
30 d.UID_DialogCountry as uid from DialogState i join deleted d on i.UID_DialogState = d.UID_DialogState where isnull(i.IsInUse, 0) <> isnull(d.IsInUse, 
310) or isnull(i.UID_DialogCountry, '') <> isnull(d.UID_DialogCountry, '') ) as x exec QBM_PDBQueueInsert_Bulk 'QBM-K-CommonCountryUTCOffset', @DBQueueElements_02
32 end END TRY BEGIN CATCH exec QBM_PSessionErrorAdd default RAISERROR ('', 18, 1) WITH NOWAIT END CATCH EndLabel:   return end 
33

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.163

inserts DBQueue tasks uses session context values has TRY/CATCH error handling

Summary: calls QBM_PDBQueueInsert_Bulk, QBM_PSessionErrorAdd; writes INSERT into, UPDATE not; reads/joins inserted, deleted, DialogState, QBM_VQBMRelation, DialogTable

Declared parameters

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

DML targets

INSERT into UPDATE not

Config/session

Config: None extracted.

Session: None extracted.

DBQueue/tasks

QBM-K-CommonStateUTCOffset2 QBM-K-CommonStateUTCOffset QBM-K-CommonCountryUTCOffset

Temp tables / referenced variables

Temp: #Verwaltungseinheit #LDS #Changes

Variables: @SQLCmd @DebugSwitch @GenProcID @ElemKey @Message @message @DBQueueElements_01 @DBQueueElements_02

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.