我可以使用
SELECT COUNT(*)
FROM information_schema.routines
WHERE routine_type = 'FUNCTION'
但这会返回所有函数,无论是标量值函数、内联函数还是表值函数
But this returns all functions whether it be a scalar-valued function, an inline function or a table-valued function
有没有办法获得特定于函数类型的计数?例如.只计算内联函数?
Is there a way to obtain a count specific to the type of function? E.g. count inline functions only?
您所追求的这种区别是特定于 SQL Server 的,可能没有包含在 information_schema 标准中.您需要查看系统视图:
This distinction you are after is specific to SQL Server and probably not covered by the information_schema standard. You need to look at system views for that:
select o.type_desc, count(*)
from sys.objects o
where o.type in ('AF', 'FN', 'FS', 'FT', 'IF', 'TF')
group by o.type_desc
order by o.type_desc;
根据您使用的 SQL Server 版本,可用对象类型列表可能会有所不同.请参阅文档 对于您的版本.
Depending on the version of SQL Server you are using, the list of available object types might differ. Consult with the documentation for your version regarding that.
这篇关于根据类型计算 SQL Server 用户创建的函数的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
修改现有小数位信息Modify Existing decimal places info(修改现有小数位信息)
多次指定相关名称“CONVERT"The correlation name #39;CONVERT#39; is specified multiple times(多次指定相关名称“CONVERT)
T-SQL 左连接不返回空列T-SQL left join not returning null columns(T-SQL 左连接不返回空列)
从逗号或管道运算符字符串中删除重复项remove duplicates from comma or pipeline operator string(从逗号或管道运算符字符串中删除重复项)
将迭代查询更改为基于关系集的查询Change an iterative query to a relational set-based query(将迭代查询更改为基于关系集的查询)
将零连接到 sql server 选择值仍然显示 4 位而不是concatenate a zero onto sql server select value shows 4 digits still and not 5(将零连接到 sql server 选择值仍然显示 4 位而不是 5)