Created
April 4, 2013 18:00
-
-
Save troyscott/5312598 to your computer and use it in GitHub Desktop.
List of computed columns by table for a database.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| select | |
| s.name SchemaName | |
| ,object_name(cc.object_id) as TableName | |
| ,c.is_computed | |
| ,cc.name | |
| ,cc.column_id | |
| ,cc.definition | |
| from sys.computed_columns cc inner join sys.columns c | |
| on cc.object_id = c.object_id and cc.column_id = c.column_id | |
| inner join sys.tables t on t.object_id = c.object_id | |
| inner join sys.schemas s on s.schema_id = t.schema_id | |
| order by SchemaName, TableName, c.column_id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment