Get DataType of computed column from dacpac

835 views Asked by At

When traversing a Dacpac via C# code, I am able to figure out which columns are referenced in a computed column (GetReferenced(Microsoft.SqlServer.Dac.Model.Column.ExpressionDependencies)), and what the expression for the column is (Microsoft.SqlServer.Dac.Model.Column.Expression property). What I cannot find, is the datatype of the computed column.

Besides that, I also cannot find a way to retrieve the columns of a FileTable table (although this is a static set of columns).

Search engines won't bring me far; there aren't that many resource to be found on this topic.

1

There are 1 answers

5
Ed Elliott On BEST ANSWER

I have blogged here how to get the data type of columns:

http://sqlserverfunctions.wordpress.com/category/dacfx-2/

I haven't tried it on computed columns.

To get columns for a file table, follow the blog but replace Table.Columns ModelRelationshipClass with FileTable.Columns ModelRelationshipClass.

Ed