Creating local cubes with AMO

Interesting nugget from the MSDN Forum, in a post by Adrian Dumitrascu: you can create local cubes in AMO. Here’s the text of the post:
AMO (Analysis Management Objects, the object model for administering AS2005, the successor for DSO from AS2000) also works with local cube files (.cub). You can use it to create/alter objects or to refresh the data by re-processing every night, as you mentioned.
Sample code to connect to a local cube file:

using Microsoft.AnalysisServices; // the .dll is in "%ProgramFiles%\Microsoft SQL Server\90\SDK\Assemblies", also in GAC

Server server = new Server();
server.Connect(@"Data Source=c:\MyLocalCube.cub"); // this will create an empty local cube if not there already
… // do something, for example process cubes

Makes sense that you can do this, when you think about it, given that everything’s XMLA behind the scenes.

One thought on “Creating local cubes with AMO

  1. Hi Chris,It is a help full two lines of code. I developed an application that generates a cube on server programmatically. Previous version of my application was creating local cube using DSO. After switching to AMO I couldn\’t find a way to create a local cube. May be this will help. I didn\’t try this method yet. But I will inform you as soon.I really want to show you a video of my application. It is a combination of Linear Programming algorithms, AMO and ProClarity.Regards,Muti.Note: Please e-mail me on

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s