Select Columns of a View

后端 未结 5 1845
我寻月下人不归
我寻月下人不归 2021-02-11 17:11

I\'m attempting to select the column names of a view in a similar way as selecting from information_schema.columns.

I can\'t seem to find a wa

5条回答
  •  死守一世寂寞
    2021-02-11 17:40

    SELECT distinct VIEW_NAME
      ,TABLE_SCHEMA
      ,TABLE_NAME
      ,COLUMN_NAME
    FROM   INFORMATION_SCHEMA.VIEW_COLUMN_USAGE
    --WHERE  TABLE_SCHEMA = 'Person'
    ORDER BY
       VIEW_NAME
      ,TABLE_SCHEMA
      ,TABLE_NAME
      ,COLUMN_NAME
    

提交回复
热议问题