对于常量生成器,我喜欢获取所有表值函数的结果列的元数据(每个表值函数返回的列的名称是什么).我怎么能得到它们?我是否必须解析函数的源代码,或者是否有提供此信息的接口?
谢谢你的帮助
克里斯
SELECT udf.name AS Name,SCHEMA_NAME(udf.schema_id) AS [Schema] FROM master.sys.databases AS dtb,sys.all_objects AS udf WHERE dtb.name = DB_NAME() AND (udf.type IN ('TF','FT')) AND SCHEMA_NAME(udf.schema_id) <> 'sys'
解决方法
此信息可在
sys.columns
中获得
Returns a row for each column of an object that has columns,such as
views or tables. The following is a list of object types that have
columns:
SELECT * FROM sys.columns WHERE object_id=object_id('dbo.YourTVF')