dbo.QBM_FSQFunctionCallModuleOwner
Scalar FunctionSQL_SCALAR_FUNCTIONSandbox DB
Interpretation
- Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.
Relations
- No extracted relations.
Typed Edges
- references source dbo.QBM_FCVGUIDToModuleOwner source text reference
- references source dbo.QBM_FCVObjectKeyToModuleOwner source text reference
Complete Source
1CREATE FUNCTION dbo.QBM_FSQFunctionCallModuleOwner(2 @TableName varchar(30),3 @TableSynonym varchar(30)4) RETURNS nvarchar(2565)6AS7BEGIN8 DECLARE @erg nvarchar(256)9 DECLARE @PkName1 varchar(30) = NULL10 SELECT TOP 1 @PkName1 = t.PKName111 FROM DialogTable t12 WITH(readpast)13 WHERE14 isnull(t.PKName2,15 '') = '' AND t.TableName = @TableName AND NOT EXISTS(16 SELECT TOP 1 117 FROM QBM_VStartupTables s18 WHERE19 s.TableName = @TableName)20 IF @PkName1 IS NULL21 BEGIN22 SELECT23 @erg = CONCAT('dbo.QBM_FCVObjectKeyToModuleOwner(',24 @TableSynonym,25 '.XObjectKey)')26 END27 ELSE28 BEGIN29 SELECT30 @erg = CONCAT('dbo.QBM_FCVGUIDToModuleOwner(',31 @TableSynonym,32 '.',33 @PkName1,34 ' )')35 END36 RETURN(@erg)37END
Open raw exported source
1 create function dbo.QBM_FSQFunctionCallModuleOwner(@TableName varchar(30) , @TableSynonym varchar(30) ) returns nvarchar(256) as begin declare2 @erg nvarchar(256) declare @PkName1 varchar(30) = null select top 1 @PkName1 = t.PKName1 from DialogTable t with (readpast) where isnull(t.PKName2 , ''3) = '' and t.TableName = @TableName and not exists (Select top 1 1 from QBM_VStartupTables s where s.TableName = @TableName ) if @PkName1 is null begin4 select @erg = concat('dbo.QBM_FCVObjectKeyToModuleOwner(' , @TableSynonym , '.XObjectKey)') end else begin select @erg = concat('dbo.QBM_FCVGUIDToModuleOwner('5 , @TableSynonym , '.' , @PkName1 , ' )') end return (@erg) end 6