Question

Is it possible to query an SSAS database using MDX and use this as a datasource for Rhino ETL? I am talking about making an OLE DB connection to the SSAS instance here.

Thanks!

Was it helpful?

Solution

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());
    }
}

OTHER TIPS

I don't know Rhino ETL, but you can do this with SSAS and SSIS.

yes you can: http://msdn.microsoft.com/en-us/library/ms146862(v=sql.90).aspx

"Client applications can connect to a local cube and execute queries using Multidimensional Expressions (MDX) without interacting with the full-scale server running the instance of Analysis Services."

not sure if it would work with rhino, though.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top