从dacpac获取计算列的DataType [英] Get DataType of computed column from dacpac

查看:75
本文介绍了从dacpac获取计算列的DataType的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

通过C#代码遍历 Dacpac 时,我能够找出在计算列中引用了哪些列( GetReferenced(Microsoft.SqlServer .Dac.Model.Column.ExpressionDependencies)),以及列的表达式是什么( Microsoft.SqlServer.Dac.Model.Column.Expression 属性)。我找不到的是计算列的数据类型。

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.

除此之外,我还找不到一种方法来检索 FileTable的列表(尽管这是一组静态列)。

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.

推荐答案

我已经在这里写过如何获取的数据类型的信息。列:

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.

要获取文件表的列,请关注博客,但将Table.Columns ModelRelationshipClass替换为FileTable.Columns ModelRelationshipClass。

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

Ed

这篇关于从dacpac获取计算列的DataType的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆