Get DataType of computed column from dacpac

╄→尐↘猪︶ㄣ 提交于 2019-12-11 03:57:21

问题


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:


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



来源:https://stackoverflow.com/questions/27259640/get-datatype-of-computed-column-from-dacpac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!