Get DataType of computed column from dacpac

2019-07-11 08:53发布

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条回答
smile是对你的礼貌
2楼-- · 2019-07-11 09:41

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

查看更多
登录 后发表回答