This project is read-only.
Update: 3/1/2011

The latest version is working on SQL 2008 R2.

Readme for MDX Parameter Sample
Updated: 15 July 2008
The MDX Parameter sample is a tool that can capture SQL Server Analysis Services (SSAS) MDX query trace with parameter values, and substitute the MDX query parameter names with values. After the MDX parameters are substituted with parameter values, it is easier to debug and test the MDX query in SQL Server 2005 Management Studio.
Scenario
If you have a SQL Server Reporting Services report with dataset that takes report input parameters in MDX query, this utility allows you capture the MDX query if the report returns error or the query result is not expected.
Languages
C#
Features
The Activity Viewer sample uses the following SQL Server 2005 features:
Application Area Features
Overall AMO, ADO.NET, Profiler Trace
Prerequisites
Before you run this sample, make sure that the following software is installed:
• Microsoft SQL Server 2005 database engine
• Microsoft SQL Server 2005 Analysis Services (SSAS)
• Microsoft SQL Server 2005 Reporting Services (SSRS)
• Microsoft SQL Server 2005 workstation tools including SQL Server Profiler.
• .NET Framework SDK 2.0 or Microsoft Visual Studio 2005. The .NET Framework SDK is available free of charge. For more information, see Installing the .NET Framework SDK in SQL Server 2005 Books Online.
Note: This sample does not work with SQL Server 2008.
Building the Sample
• In Microsoft Visual Studio 2005, compile the sample by using the provided Visual Studio solution

Running the Sample
1. Makes sure the Profiler template QueryBegin.tdf is in the same location as MDXParameter.exe after you compile the project.
2. Run MDXParameter.exe
3. Fill in the SSAS Server name, SQL Server instance name, SQL Server database name and table name for saving the Profiler trace. The SQL Server table will be created automatically after you start the trace.
4. Click OK to confirm the configuration settings.
5. Click Start Trace.
6. Execute the SSRS Report you want to troubleshoot.
7. Click Stop Trace.
8. If you want to filter the Profiler trace events, you can click Modify SQL Query to add more filters
9. The data grid will show the Profiler event, the MDX query, and the parameter.
10. Click on the MDX query you are interested in
11. The MDX tab shows the MDX query with parameter values inserted.

Last edited Mar 1, 2011 at 5:26 PM by haidongh, version 3