dbo.QBM_FSQTriggerWatchSemaphor
SQL_SCALAR_FUNCTION
Created 2025-06-27T17:57:36.847 · modified 2026-04-14T23:20:26.783 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| nvarchar | yes |
@TableName | nvarchar | no |
@operation | nvarchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| dbo | DialogColumn | OBJECT_OR_COLUMN | |
| dbo | DialogColumnHasSemaphor | OBJECT_OR_COLUMN | |
| dbo | DialogSemaphor | OBJECT_OR_COLUMN | |
| dbo | DialogTable | OBJECT_OR_COLUMN |
Source excerpt
First extracted SQL definition lines from the exported source. Use the full source page for complete context.
1 create function dbo.QBM_FSQTriggerWatchSemaphor (@TableName nvarchar(64), @operation nvarchar(16) ) returns nvarchar(max) as begin declare 2 @erg nvarchar(max) = '' declare @medium nvarchar(max) declare @pattern nvarchar(max) = ' if @IsSemaphorInFullsync = 1 3 begin 4 if not exists 5 (select top 1 1 6 from DialogDBQueue q with (readpast) 7 where q.UID_Task = ''QBM-K-CommonIncSemaphorPost'' 8 and q.Object = ''@Semaphorname@'' 9 and q.Generation >= 0 10 ) 11 begin 12 exec QBM_PDBQueueInsert_Single ''QBM-K-CommonIncSemaphorPost'', ''@Semaphorname@'', null, @GenProcID 13 end 14 end 15 else 16 begin 17 if not exists 18 (select top 1 1 19 from DialogDBQueue q with (readpast) 20 where q.UID_Task = ''QBM-K-CommonIncSemaphor'' 21 and q.Object = ''@Semaphorname@'' 22 and q.Generation >= 0 23 ) 24 begin 25 exec QBM_PDBQueueInsert_Single ''QBM-K-CommonIncSemaphor'', ''@Semaphorname@'', null, @GenProcID 26 end 27 end' 28 + nchar(13) + nchar(10) select @medium = string_agg(convert(nvarchar(max), concat( case @operation when 'update' then concat(' if update(' , z.columnname 29 , ')' , nchar(13) , nchar(10), ' begin' , nchar(13) , nchar(10) ) else '' end , z.zeile , case @operation when 'update' then concat(' end -- if update(' 30 , z.columnname , ')' , nchar(13) , nchar(10) ) else '' end ) ) , nchar(13) + nchar(10) ) from ( select y.columnname, string_agg( replace(@pattern, 31'@Semaphorname@', y.SemaphorName) , nchar(13) + nchar(10) ) within group (order by y.SemaphorName) as zeile from ( select distinct case @operation when 32 'update' then a.columnname else '' end as columnname, a.Semaphorname from ( select distinct c.ColumnName, se.ChangeContext as SemaphorName from dbo.DialogTable 33 t with (readpast) join dbo.DialogColumn c with (readpast) on t.UID_DialogTable = c.UID_DialogTable and t.TableName = @TableName join dbo.DialogColumnHasSemaphor 34 ch with (readpast) on c.UID_DialogColumn = ch.UID_DialogColumn join dbo.DialogSemaphor se with (readpast) on ch.UID_DialogSemaphor = se.UID_DialogSemaphor 35 where ( c.IsPKMember = 1 and @Operation = 'insert' or c.IsPKMember = 0 and @Operation = 'update' or c.IsPKMember = 1 and @Operation = 'delete' ) ) as 36a ) as y group by y.columnname ) as z if @medium > ' ' begin select @erg = concat(replicate(N'-', 64) , nchar(13) , nchar(10) , N'-- SemaphorCheck' , nchar 37(13) , nchar(10) , replicate(N'-', 64) , nchar(13) , nchar(10) , @medium , replicate(N'-', 64) , nchar(13) , nchar(10) , N'-- / SemaphorCheck' , nchar(13 38) , nchar(10) , replicate(N'-', 64) , nchar(13) , nchar(10) ) end ende: return(@erg) end 39
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.783
inserts DBQueue tasks
Summary: calls QBM_PDBQueueInsert_Single; reads/joins DialogDBQueue, DialogTable, DialogColumn, DialogColumnHasSemaphor, DialogSemaphor
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
| nvarchar | OUTPUT |
@TableName | nvarchar(64) | input |
@operation | nvarchar(16) | input |
DML targets
None extracted.Called routines
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
QBM-K-CommonIncSemaphorPost QBM-K-CommonIncSemaphorTemp tables / referenced variables
Temp: None extracted.
Variables: @TableName @operation @erg @medium @pattern @IsSemaphorInFullsync @Semaphorname @GenProcID @Operation
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.QBM_PTriggerWatchCreate | SQL expression dependency | dbo · OBJECT_OR_COLUMN |