0

是否可以使用 MDX 查询 SSAS 数据库并将其用作 Rhino ETL 的数据源?我在这里谈论的是与 SSAS 实例建立 OLE DB 连接。

谢谢!

4

3 回答 3

3

If you're using Rhino ETL within a .NET application, then yes. First, reference Microsoft.AnalysisServices.AdomdClient.dll. Then, implement Rhino ETL's AbstractOperation to extract the data. Here's an example:

namespace Etl.Operations
{
    public class ExtactFromAnalysisServices : AbstractOperation
    {
        private readonly AdomdConnection _connection;
        private readonly string _mdx;

        public ExtactFromAnalysisServices(string connectionString, string mdx)
        {
            _connection = new AdomdConnection(connectionString);
            _mdx = mdx;

            _connection.Open();
        }

        public override IEnumerable<Row> Execute(IEnumerable<Row> rows)
        {
            var command = _connection.CreateCommand();

            command.CommandText = _mdx;

            using (var reader = command.ExecuteReader())
                while (reader.Read())
                    yield return Row.FromReader(reader);
        }

        public sealed override void Dispose()
        {
            _connection.Close();
            _connection.Dispose();
            base.Dispose();
        }
    }
}

Use it in a process like this:

public class Process : EtlProcess
{
    protected override void Initialize()
    {
        Register(new ExtactFromAnalysisServices("connection string", "mdx query"));
        Register(new SomeTransform());
        Register(new SomeLoad());
    }
}
于 2012-12-28T16:47:54.897 回答
0

是的,你可以: http: //msdn.microsoft.com/en-us/library/ms146862 (v=sql.90).aspx

“客户端应用程序可以连接到本地多维数据集并使用多维表达式 (MDX) 执行查询,而无需与运行 Analysis Services 实例的完整服务器交互。”

不过,不确定它是否适用于犀牛。

于 2012-07-16T13:21:46.020 回答
0

我不知道 Rhino ETL,但你可以用 SSAS 和 SSIS 做到这一点。

于 2012-07-13T14:32:12.880 回答