Getting the result columns of table valued functions in SQL Server 2008 R2

后端 未结 1 822
孤城傲影
孤城傲影 2021-02-14 22:14

For a constants generator I like to get the meta data of result columns for all my table valued functions (what are the names of the columns returned by each table valued functi

1条回答
  •  挽巷
    挽巷 (楼主)
    2021-02-14 22:46

    This information is available in 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:

    • Table-valued assembly functions (FT)

    • Inline table-valued SQL functions (IF)

    • Internal tables (IT)

    • System tables (S)

    • Table-valued SQL functions (TF)

    • User tables (U)

    • Views (V)

    SELECT *
    FROM sys.columns
    WHERE object_id=object_id('dbo.YourTVF')
    

    0 讨论(0)
提交回复
热议问题