Juul van Iersel
Juul van Iersel

Reputation: 23

Get DataType of computed column from dacpac

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.

Upvotes: 2

Views: 877

Answers (1)

Ed Elliott
Ed Elliott

Reputation: 6856

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

Upvotes: 2

Related Questions