Exporting MDX queries to SQL Relational Databases using SSIS 2005

  • Comments posted to this topic are about the item Exporting MDX queries to SQL Relational Databases using SSIS 2005

  • Very interesting article. Always neat to see how other people go about solving problems and coming up with solutions. I also had to deal with getting SSAS data into SSRS and putting it in a format that would easily work with SSRS. I looked at SSIS as a source for the report and actually combining the data within SSIS to output to SSRS. I did like that approach, but in the end we ended up going with a linked server and using stored procedures to use as the source for the SSRS reports.

    Using Reporting Services (SSRS) with SSAS data

    You don't see me using relational data in the example, but he had to in some reports where we would actually configure how to rate items based on a tie breaker in the rankings.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • We had a similar requirement and i used the following steps to export OLAP data into relational tables.

    1) Create a linked server to the SSAS OLAP Cube in Management studio.

    2) Run an openquery against the linkedserver

    Ex:

    SELECT * into TempTable FROM OPENQUERY(Linkedservername,'select {[Measures].[Count]} on columns from XXX')

    3) Edit the TempTable design to assign correct column names etc.

    Hope this helps.

  • Excellent explanation. Good one...

  • Nice article. But I think the text has become a bit disordered. For example check the paragraph

    "Drag an OLE DB Destination item onto the Data Flow task designer. Name it SQL Destination and drag a Green connector to it from the Data Conversion task. Right click the OLE DB Destination item and select Edit. Select your relational database server and database in the Connection Manager, leave the Data access mode to Table or View, and select the table you just cre"

    It ends abruptly and continues after the paragraph

    I hope this article has shown you the power SSIS has when it comes to transforming data from an MDX query into SQL tables. One modification you may consider is building the MDX query in a Script, passing it to a variable which is then passed to the Execute SQL Task command. The advantage with this method is you can pass parameters to the scripted MDX query and for example loop through multiple departments in SSIS. Your database table will then contain the combined data from multiple departments using the same MDX query.

    The article needs to be edited back into the correct order.

  • I found the article quite interesting but when I tried to implement I get an error(Failed validation and returned error code OxC020801C) when I add the Format=Tabular to the connection string for the MDX source. Any ideas why this would be?

  • Can you provide some more information in regards to the error that you are seeing? At what point in the package are you getting the error? If you use the OLEDB data source you definitely need to incorporate Format=Tabular in the connection string. What version of SSIS are you using?

    I have a Microsoft Connect item currently submitted for a bug with SSIS 2008 in regards to the ADO NET source and there is still an issue when use the OLEDB source in a Data Flow Task within a Loop Container that I have logged here - SSIS 2008 ADO NET Source issue with SSAS data source - error code 0x80004002.

    I also have a posting about using SSAS data with SSRS and this does talk about using SSIS against SSAS also.

    Using Reporting Services (SSRS) with SSAS data

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • I am impleminting this using an data cube on an anlysis server we have here I am getting the error when selecting the columns option in the OLE DB Source editor. If I remove the Column=Tabular option I do not get the error, of course the package does not work correctly either.

    I am using SSIS designer version 9.00.1399.00

    The error message is a little different today:

    Error at Package2[Connection Manager "Finanace2"}: An OLE DB error has occurred. Error Code: 0x8004005

    An OLE DB record is available. Source:"Microsoft OLE DB Provider for Analysis Services 2005" Hresuslt: 0x80004005 Description: "Internal error: An unexpected exception occurred."

    An OLE DB record is available. Source:"Microsoft OLE DB Provider for Analysis Services 2005" Hresuslt: 0x80004005 Description: "XML parsing failed at line 1, column 510: unexpected end of input."

    Error at from MDX to SQL [MDX Source[1]]: The AcquireConnection method call to the connection manager "Finance2" failed with error code oxC0202009.

    Additional information:

    Exception from HRESULT: 0xC020801C (Microsoft.SqlServer.DTSPipelineWrap)

  • You definitely need to use Format=Tabular in the connection string with the OLE DB source going against an SSAS source. I would highly recommend installing the latest service pack, SQL Server 2005 Service Pack 3 (SP3) – now available, also since you are only using the RTM release (SQL Server 2005 Build List[/url]).

    Are you able to preview the SQL Command properly in the OLE DB source in the Data Flow Task? You could also setup a trace on the SSAS instance with Profiler to see what if anything is being passed to further troubleshoot this issue. Setup logging on the package to and see if you can get additional information in regards to the specifics of the error. This might have been resolved in a service pack too, so I would recommend getting up-to-date with that first.

    ----------------------------------------------------------------------------------------
    Dan English - http://denglishbi.wordpress.com

  • Thanks for the tip. I installed the microsoft updates and it works now.

  • Hi,

    In the Data access mode drop down box i select SQL Command, and paste the following MDX Query into the SQL command text box.

    SELECT NON EMPTY { [Measures].[SaleAmount], [Measures].[SaleCount]} ON COLUMNS,

    NON EMPTY { ([Customer].[Customer].[Customer].ALLMEMBERS

    * [Date].[Year-Month].[Month].ALLMEMBERS

    * [Date].[Year].[Year].ALLMEMBERS) }

    DIMENSION PROPERTIES MEMBER_CAPTION, MEMBER_UNIQUE_NAME ON ROWS

    FROM [CustomerAnalysis]

    CELL PROPERTIES VALUE, BACK_COLOR, FORE_COLOR, FORMATTED_VALUE, FORMAT_STRING, FONT_NAME, FONT_SIZE, FONT_FLAGS

    then when i clicked the Columns menu item, the program did NOT response. it was blocked.

    I guessed that was because SSAS was parsing the mdx query.

    BIDS finally issued an out-of-memory error.

    in fact, if executed, the mdx query should return tens of millions of records. and i'm pretty sure that parsing a mdx query is essentially executing the query and then discarding the results.

    it seems mdx query is not suitable for extracting large amount of data from a cube, am i right?

    Andrew

    Andrew

  • I wouldn't use MDX to extract tens of millions of rows. Analysis Services performs better with data sliced and aggregated to more manageable levels. Your data warehouse should be summarizing/aggregating/grouping data for Analysis Services to use. If you need to extract tens of millions of rows this should be done in TSQL\BCP exporting to .csv files.

  • I followed the steps but when i add Format=tabular and try to click on test connection i get the following error

    Test connection failed because of an error in initializing provider. Internal error: An unexpected exception occured.

    Internal error: An unexpected exception occured.

    XML parsing failed at line 1, column 515: Unexpected end of input.

    .

    I am using SQL Server 2005 SP3.

    Thanks

  • Thanks for the post, however when I am implementing it in my package it's not very consistent.

    I have my SSIS 2005 package which fetches data from SSAS 2008. The MDX query takes around 5 minutes to execute and the package when runs succesfully takes almost the double time (validation + execution). But sometimes the package stop abruptly and I see below errors -

    1.

    Error: An OLE DB error has occurred. Error code: 0x80004005. An OLE DB record is available. Source: "Microsoft OLE DB Provider for Analysis Services 2008." Hresult: 0x80004005 Description: "Server: The operation has been cancelled.".

    And some times this one -

    2.

    Error: An OLE DB error has occurred. Error code: 0x80040E05. An OLE DB record is available. Source: "Microsoft OLE DB Provider for Analysis Services 2008." Hresult: 0x00000001 Description: "Error Code = 0x80040E05, External Code = 0x00000000:.".

    Any idea what is the issue here? I have increased TimeOut and ConnectionTimeOut, and it made the package more stable but somehow it's not 100%.

    Any help/idea here would be really appreciated. Thanks again for your post!

    Kind regards,

    Santosh Joshi

Viewing 14 posts - 1 through 13 (of 13 total)

You must be logged in to reply to this topic. Login to reply