Get List of Computed Columns in Database Table (SQL Server)

前端 未结 4 1924
眼角桃花
眼角桃花 2020-12-05 09:42

Would any of you know how to get the list of computed columns in a SQL Server database table?

I found sys.sp_help tablename does return this information, but only i

4条回答
  •  感动是毒
    2020-12-05 10:19

    If you have many tables with computed columns and want to see the table names as well:

    SELECT sys.objects.name, sys.computed_columns.name
    from sys.computed_columns 
    inner join sys.objects on sys.objects.object_id = sys.computed_columns.object_id
    order by sys.objects.name
    

提交回复
热议问题