dbo.QBM_FSQObjectComment

SQL_SCALAR_FUNCTION

Created 2025-06-27T17:56:59.973 · modified 2026-04-14T23:14:10 · source: live DB sys.objects/sys.sql_expression_dependencies.

Open formatted source/search result

Parameters

NameTypeOutput
nvarcharyes
@Objectnamenvarcharno

Referenced objects

SchemaObjectColumn/minorClass
QBM_YCursorBufferTYPE

Source excerpt

First extracted SQL definition lines from the exported source. Use the full source page for complete context.

Open full formatted source

1    create   function dbo.QBM_FSQObjectComment (@Objectname nvarchar(64) ) returns nvarchar(max)  as begin declare @crlf nvarchar(10) = nchar(13
2) + nchar(10) declare @erg nvarchar(max) = N'' declare @Objecttype nvarchar(10) = null declare @ParameterName nvarchar(64) declare @ParameterType nvarchar
3(64) declare @ParameterLen nvarchar(64) declare @TableName nvarchar(64) declare @operation nvarchar(64) declare @ReturnValue nvarchar(max) = N'' declare
4 @ElementCount int declare @ElementIndex int declare @ElementLast int declare @ElementBufferMulti QBM_YCursorBuffer select top 1 @Objecttype = type from
5 sys.objects with (readpast) where name = @Objectname if @Objecttype is null begin goto ende end if @Objecttype = N'TR' begin select top 1 @TableName =
6 ta.name, @operation = ev.type_desc from sys.triggers t with (readpast) join sys.objects ta with (readpast) on t.parent_id = ta.object_id join sys.trigger_events
7 ev with (readpast) on ev.object_id = t.object_id where t.name = @Objectname and t.name != 'QBM_TUIndicator474488' select @erg = @erg + @crlf + N'---<summary>:DE:'
8 + @operation + N'-Trigger für Tabelle ' + @TableName + N' </summary>' end else begin select @erg = @erg + @crlf + N'---<summary>:DE:'+ N'T' + N'O' + N'D'
9 + N'O'+ N': allgmeine Beschreibung von ' + @Objectname + N' </summary>' end  delete  @ElementBufferMulti insert into @ElementBufferMulti (LongIdent1, 
10LongIdent2, Ident1)  select PARAMETER_NAME , DATA_TYPE, case CHARACTER_MAXIMUM_LENGTH when null then N'' when -1 then N'max' else convert(nvarchar(16),
11 CHARACTER_MAXIMUM_LENGTH) end from information_schema.parameters with (readpast) where specific_name = @Objectname order by Ordinal_position select @ElementCount
12 = @@ROWCOUNT select @ElementIndex = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY while @ElementIndex <= @ElementLast begin select top
13 1 @parameterName = bu.LongIdent1 , @parameterType = bu.LongIdent2 , @parameterLen = bu.Ident1 from @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex
14 if left(@parametername, 1) = N'@' begin select @parametername = substring(@parametername, 2, 255) end  if @parameterlen > N'' begin select @parametertype
15 = @parametertype + N'(' + @parameterlen + N')' end if @parametername > ' ' begin select @erg = @erg + @crlf + N'---<param name="' + @parameterName + '" type="'
16 + @parametertype + '">'+ N'T' + N'O' + N'D' + N'O'+ N': Parameter-Beschreibung einfügen</param>' end else begin  select @ReturnValue = N'---<returns Type="'
17 + @parametertype + '">'+ N'T' + N'O' + N'D' + N'O'+ N': ReturnValue-Beschreibung einfügen</returns>' end select @ElementIndex += 1 end  if @ReturnValue
18 > ' ' begin select @erg = @erg + @crlf + @returnvalue end else begin  delete  @ElementBufferMulti insert into @ElementBufferMulti (LongIdent1, LongIdent2
19, Ident1) select c.name , t.name, c.max_length / 2 from sys.columns c with (readpast) join sys.types t with (readpast) on c.user_type_id = t.user_type_id
20 where c.object_id = object_id(@Objectname)  and not exists (select top 1 1 from information_schema.parameters p with (readpast) where p.specific_name 
21= @Objectname and p.PARAMETER_NAME = c.name ) order by c.column_id select @ElementCount = @@ROWCOUNT select @ElementIndex = @@IDENTITY - @ElementCount 
22+1 select @ElementLast = @@IDENTITY while @ElementIndex <= @ElementLast begin select top 1 @parameterName = bu.LongIdent1 , @parameterType = bu.LongIdent2
23 , @parameterLen = bu.Ident1 from @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex  select @ReturnValue = @ReturnValue + @crlf + N'---<tr><td>'
24 + @ParameterName + N'</td><td>' + @parameterType + N'</td><td>' + @parameterlen + N'</td></tr>' select @ElementIndex += 1 end   if @returnValue > ' ' 
25begin select @erg = @erg + @crlf + N'---<returns>'+ @crlf + N'---<table><tr><th>column name</th><th>data type</th><th>length</th></tr>' + @returnvalue 
26+ N''+ @crlf + N'---</table>'+ @crlf + N'---</returns>' end end if @Objecttype = N'TR' begin  select @erg = @erg + N''+ @crlf + N'---<remarks>Einstellen der DBScheduler-Operation '
27+ N'T' + N'O' + N'D' + N'O'+ N': ' + @crlf + N'---</remarks>' end else begin  select @erg = @erg + N''+ @crlf + N'---<remarks>'+ N'T' + N'O' + N'D' + N'O'
28+ N': Bemerkungen einfügen</remarks>'+ @crlf + N'---<example>'+ @crlf + N'---<code>'+ @crlf + N'---'+ N'T' + N'O' + N'D' + N'O'+ N': Aufrufbeispiel eintragen'
29+ @crlf + N'---</code></example>' end  delete  @ElementBufferMulti insert into @ElementBufferMulti (LongIdent1, LongIdent2) select distinct p.name, case
30 p.type when 'P' then 'Procedure' when 'FN' then 'Function' when 'TF' then 'Table-Function' when 'IF' then 'Table-Function' when 'V' then 'View' else p.type
31 end from sys.sql_dependencies d with (readpast) join sys.objects o with (readpast) on d.object_id = o.object_id join sys.objects p with (readpast) on 
32d.referenced_major_id = p.object_id where o.object_id = object_id(@Objectname) and p.type not in (N'U', N'V') order by p.name select @ElementCount = @@ROWCOUNT
33 select @ElementIndex = @@IDENTITY - @ElementCount +1 select @ElementLast = @@IDENTITY while @ElementIndex <= @ElementLast begin select top 1 @ParameterName
34 = bu.LongIdent1 , @Parametertype = bu.LongIdent2 from @ElementBufferMulti bu where bu.ElementIndex = @ElementIndex select @erg = @erg + @crlf + N'---<seealso cref="'
35 +@parametername + N'" type="' +@parametertype + N'">' + @Parametertype + N' ' + @parametername + N'</seealso>' select @ElementIndex += 1 end  ende: return
36(@erg) end 
37

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:14:10

None extracted.

Summary: writes INSERT into; reads/joins sys, information_schema

Declared parameters

ParameterTypeDirection
nvarcharOUTPUT
@Objectnamenvarchar(64)input

DML targets

INSERT into

Called 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: @Objectname @crlf @erg @Objecttype @ParameterName @ParameterType @ParameterLen @TableName @operation @ReturnValue @ElementCount @ElementIndex @ElementLast @ElementBufferMulti @ROWCOUNT @IDENTITY @parameterName @parameterType @parameterLen @parametername @parameterlen @parametertype @returnvalue @returnValue @Parametertype

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 objectRelationEvidence
dbo.QBM_PTriggerDropSQL expression dependencydbo · OBJECT_OR_COLUMN