SQL Server - where is “sys.functions”?

后端 未结 10 1364
天命终不由人
天命终不由人 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 10:05

    For a fuller description of scalar functions including owner and return type:

    SELECT f.name, s.name AS owner, t.name as dataType, p.max_length, p.precision, p.scale, m.definition
    FROM sys.objects f
    JOIN sys.schemas s on s.schema_id = f.schema_id
    JOIN sys.parameters p on p.object_id = f.object_id AND p.parameter_id = 0
    JOIN sys.types t ON t.system_type_id = p.system_type_id 
    JOIN sys.sql_modules as m ON m.object_id = f.object_id
    WHERE type='FN';
    

提交回复
热议问题