Back to OIM Explorer

dbo.QBM_FTSchemaDependencies

Inline Table FunctionSQL_INLINE_TABLE_VALUED_FUNCTIONSandbox DB

Inline Table Function.

Source: sandbox-db sys.sql_modules

Source size: 1.338 characters

Interpretation

  • Database function. Usually supports views, validation, or calculated predicates; look at referenced-by entries for callers.

Relations

  • No extracted relations.

Typed Edges

  • No typed edges extracted for this source.

References

  • No direct source references extracted.

Referenced By

Complete Source

SQL53 lines
1CREATE FUNCTION dbo.QBM_FTSchemaDependencies(2  @ObjectName varchar(30),3  @ObjectNameIsSource BIT4) RETURNS TABLE5AS6RETURN(7SELECT CASE v.type8WHEN 'FN' THEN9'F'10WHEN 'IF' THEN11'F'12WHEN 'TF' THEN13'F'14WHEN 'V' THEN15'V'16WHEN 'U' THEN17'T'18ELSE ''19END AS ObjectType,20LEFT(v.name, 30) AS ObjectName,21m.definition AS SourceCode22FROM(23SELECT24  e.name, e.type, e.object_id25FROM sys.objects e26  WITH(readpast)27JOIN sys.sql_expression_dependencies dep28  WITH(readpast)29  ON dep.referencing_id = e.object_id30JOIN sys.objects abh31  WITH(readpast)32  ON dep.referenced_id = abh.object_id33WHERE34  objectproperty(e.object_id, 'IsSchemaBound') = 1 AND e.type IN('FN', 'IF', 'TF', 'V', 'U') AND(abh.name = @ObjectName AND @ObjectNameIsSource35= 1 AND e.name <> @ObjectName) AND e.name NOT LIKE 'GEN%'36UNION37SELECT38  abh.name, abh.type, abh.object_id39FROM sys.objects e40  WITH(readpast)41JOIN sys.sql_expression_dependencies dep42  WITH(readpast)43  ON dep.referencing_id = e.object_id44JOIN sys.objects abh45  WITH(readpast)46  ON dep.referenced_id = abh.object_id47WHERE48  objectproperty(e.object_id, 'IsSchemaBound') = 1 AND abh.type IN('FN', 'IF', 'TF', 'V', 'U') AND(e.name = @ObjectName AND @ObjectNameIsSource49= 0 AND abh.name <> @ObjectName) AND abh.name NOT LIKE 'GEN%') v50LEFT51OUTER52JOIN sys.sql_modules m53  ON v.object_id = m.object_id)
Open raw exported source
SQL ยท Raw10 lines
1create function dbo.QBM_FTSchemaDependencies(@ObjectName varchar(30)  , @ObjectNameIsSource bit   ) returns table as return ( select case v.type when 'FN'2 then 'F' when 'IF' then 'F' when 'TF' then 'F' when 'V' then 'V' when 'U' then 'T' else '' end as ObjectType , left(v.name, 30) as ObjectName , m.definition3 as SourceCode from ( select e.name, e.type, e.object_id from sys.objects e with (readpast) join sys.sql_expression_dependencies dep with (readpast) on4 dep.referencing_id = e.object_id join sys.objects abh with (readpast) on dep.referenced_id = abh.object_id where objectproperty(e.object_id, 'IsSchemaBound'5) = 1 and e.type in ('FN' , 'IF' , 'TF' , 'V' , 'U' ) and (abh.name = @ObjectName and @ObjectNameIsSource = 1 and e.name <> @ObjectName ) and e.name not6 like 'GEN%' union select abh.name, abh.type, abh.object_id from sys.objects e with (readpast) join sys.sql_expression_dependencies dep with (readpast)7 on dep.referencing_id = e.object_id join sys.objects abh with (readpast) on dep.referenced_id = abh.object_id where objectproperty(e.object_id, 'IsSchemaBound'8) = 1 and abh.type in ('FN' , 'IF' , 'TF' , 'V' , 'U' ) and (e.name = @ObjectName and @ObjectNameIsSource = 0 and abh.name <> @ObjectName ) and abh.name9 not like 'GEN%' ) v left outer join sys.sql_modules m on v.object_id = m.object_id ) 10