dbo.QBM_FSQBufferConfigSaveOrigin
SQL_SCALAR_FUNCTION
Created 2025-06-27T17:57:30.053 · modified 2026-04-14T23:20:26.797 · source: live DB sys.objects/sys.sql_expression_dependencies.
Parameters
| Name | Type | Output |
|---|---|---|
| nvarchar | yes |
@TableName | varchar | no |
Referenced objects
| Schema | Object | Column/minor | Class |
|---|---|---|---|
| DialogColumn | OBJECT_OR_COLUMN | ||
| DialogDatabase | OBJECT_OR_COLUMN | ||
| DialogTable | OBJECT_OR_COLUMN | ||
| dbo | QBM_FCVGUIDToModuleOwner | OBJECT_OR_COLUMN | |
| dbo | QBM_FCVStringToIndent | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQCVBufferToColumn | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQCVColumnToBuffer | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQFunctionCallModuleOwner | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQIsNullClauseCmp | OBJECT_OR_COLUMN | |
| dbo | QBM_FSQTableJoin | 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_FSQBufferConfigSaveOrigin (@TableName varchar(30)) returns nvarchar(max) as begin declare @erg nvarchar(max) = N'' 2 declare @Header nvarchar(max) = concat(' 3----------------------------------------------------------------------- 4-- save to QBMBufferConfig 5----------------------------------------------------------------------- 6 if exists (select top 1 1 7 from deleted d 8 where ' 9 , dbo.QBM_FSQFunctionCallModuleOwner (@TableName, 'd') ,' <> ''CCC'' 10 ) 11 and dbo.QBM_FGISessionContext (''HotfixMode'') = '''' 12 begin 13' ) declare 14 @Footer nvarchar(max) = concat(' 15 end -- exists ... ' , dbo.QBM_FSQFunctionCallModuleOwner (@TableName, 'd') ,' 16----------------------------------------------------------------------- 17-- / save to QBMBufferConfig 18----------------------------------------------------------------------- 19' 20 ) if exists (select top 1 1 from DialogDatabase db with (readpast) where isnull(db.ModuleOwner, '') <> 'CCC' and db.IsMainDatabase = 1 ) begin goto endLabel 21 end select @erg = STRING_AGG( convert(nvarchar(max), ' 22if update(' + x.ColumnName + ') 23 begin 24 -- something to insert 25 if exists (select top 1 1 26 from deleted d left outer join QBMBufferConfig cf on d.XObjectKey = cf.ObjectKeyOfRow 27 and cf.TableName = ''' 28 + @TableName + ''' 29 and cf.ColumnName = ''' + x.ColumnName + ''' 30 where cf.ObjectKeyOfRow is null 31 and ' + dbo.QBM_FSQFunctionCallModuleOwner 32 (@TableName, 'd') +' <> ''CCC'' 33 ) 34 begin 35 insert into QBMBufferConfig(UID_QBMBufferConfig, TableName, ColumnName, ObjectKeyOfRow, 36 XDateInserted, XDateUpdated, XUserInserted, XUserUpdated, 37 ContentShort, HasContentFull, ContentFull 38 ) 39 select newid(), ''' 40 + @TableName + ''', ''' + x.ColumnName + ''', d.XObjectKey, 41 getutcdate() , getutcdate(), @ActionUser, @ActionUser, 42' + dbo.QBM_FCVStringToIndent 43( dbo.QBM_FSQCVColumnToBuffer(@TableName , x.ColumnName, 'd'), 17) + ' 44 from deleted d join ' + @TableName + ' x on ' + dbo.QBM_FSQTableJoin(@TableName 45 , 'd', 'x') + ' 46 where ' + dbo.QBM_FSQIsNullClauseCmp(@TableName , x.ColumnName, 'd') + ' <> ' + dbo.QBM_FSQIsNullClauseCmp(@TableName , x.ColumnName 47, 'x') + ' 48 and ' + dbo.QBM_FSQFunctionCallModuleOwner (@TableName, 'd') +' <> ''CCC'' 49 and Not exists (select top 1 1 50 from QBMBufferConfig cf 51 where cf.TableName = ''' 52 + @TableName + ''' 53 and cf.ColumnName = ''' + x.ColumnName + ''' 54 and cf.ObjectKeyOfRow = d.XObjectKey 55 ) 56 end --exists something to insert 57 58 -- something to delete 59 if exists (select top 1 1 60 from deleted d join QBMBufferConfig cf on d.XObjectKey = cf.ObjectKeyOfRow 61 and cf.TableName = ''' 62 + @TableName + ''' 63 and cf.ColumnName = ''' + x.ColumnName + ''' 64 where ' + dbo.QBM_FSQFunctionCallModuleOwner (@TableName, 'd') + 65' <> ''CCC'' 66 ) 67 begin 68 69 delete QBMBufferConfig 70 from deleted d join ' + @TableName + ' x on ' + dbo.QBM_FSQTableJoin(@TableName , 'd', 71 'x') + ' 72 join QBMBufferConfig cf on cf.TableName = ''' + @TableName + ''' 73 and cf.ColumnName = ''' + x.ColumnName + ''' 74 and cf.ObjectKeyOfRow = x.XObjectKey 75 where ' 76 + dbo.QBM_FSQIsNullClauseCmp(@TableName , x.ColumnName, 'd') + ' <> ' + dbo.QBM_FSQIsNullClauseCmp(@TableName , x.ColumnName, 'x') + ' 77 and ' + dbo.QBM_FSQFunctionCallModuleOwner 78 (@TableName, 'd') +' <> ''CCC'' 79 and ' + dbo.QBM_FSQIsNullClauseCmp(@TableName , x.ColumnName, 'x') + ' = ' + dbo.QBM_FSQCVBufferToColumn (@TableName 80 , x.ColumnName , 'cf' , 1 ) + '
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.797
uses session context values
Summary: writes INSERT QBMBufferConfig, DELETE QBMBufferConfig; reads/joins deleted, DialogDatabase, QBMBufferConfig, DialogColumn, DialogTable
Declared parameters
| Parameter | Type | Direction |
|---|---|---|
| nvarchar | OUTPUT |
@TableName | varchar(30) | input |
DML targets
INSERT QBMBufferConfig DELETE QBMBufferConfigCalled routines
None extracted.
Read/join references
SQL dependency metadata
Config/session
Config: None extracted.
Session: None extracted.
DBQueue/tasks
None extracted.Temp tables / referenced variables
Temp: None extracted.
Variables: @TableName @erg @Header @Footer @ActionUser
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 |