SQL Server - where is “sys.functions”?

后端 未结 10 1347
天命终不由人
天命终不由人 2020-12-04 09:15

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

What stumbles me is this: why is there a sys.procedures

10条回答
  •  星月不相逢
    2020-12-04 09:53

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

    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
    

提交回复
热议问题