SQL Server - “sys.functions"在哪里? [英] SQL Server - where is "sys.functions"?

查看:44
本文介绍了SQL Server - “sys.functions"在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SQL Server 2005 在我经常使用的系统目录中有很好的 sys.XXX 视图.

SQL Server 2005 has great sys.XXX views on the system catalog which I use frequently.

令我困惑的是:为什么有一个 sys.procedures 视图来查看有关存储过程的信息,但没有 sys.functions 视图来查看存储过程的信息您存储的函数是否相同?

What stumbles me is this: why is there a sys.procedures view to see info about your stored procedures, but there is no sys.functions view to see the same for your stored functions?

没有人使用存储函数吗?我发现它们非常方便,例如计算列之类的!

Doesn't anybody use stored functions? I find them very handy for e.g. computed columns and such!

是否存在缺少 sys.functions 的特定原因,或者它只是被认为不够重要而不能放入 sys 目录视图的东西?它在 SQL Server 2008 中可用吗?

Is there a specific reason sys.functions is missing, or is it just something that wasn't considered important enough to put into the sys catalog views? Is it available in SQL Server 2008?

干杯,马克

推荐答案

我发现 UDF 非常方便,我一直在使用它们.

I find UDFs are very handy and I use them all the time.

我不确定微软在 SQL Server 2005(或 SQL Server 2008,据我所知)中不包含等效的 sys.functions 的理由是什么,但很容易推出自己的:

I'm not sure what Microsoft's rationale is for not including a sys.functions equivalent in SQL Server 2005 (or SQL Server 2008, as far as I can tell), but it's easy enough to roll your own:

CREATE VIEW my_sys_functions_equivalent
AS
SELECT *
FROM sys.objects
WHERE type IN ('FN', 'IF', 'TF')  -- scalar, inline table-valued, table-valued

这篇关于SQL Server - “sys.functions"在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆