Building a Visual Studio project from an existing SSAS database

Imagine you join a company, and there is an existing SSAS database that contains a few cubes that are working nicely.  You are asked to add an enhancement to one of the cubes, so you poke around in source control for the Visual Studio analysis services project, but can’t find it.  Further research reveals the developer who you replaced never did check the project into source control, leaving it instead on his laptop.  But his laptop was wiped clean when he left.  Uh oh.

Fortunately, one great thing about SSAS is you can “reverse engineer” a SSAS database and build the Visual Studio analysis services project from a deployed SSAS database.  Just go into Visual Studio, and from the menu choose File -> New -> Project… -> “Import Analysis Services 2008 Database” (in 2012 it is “Import from Server (Multidimensional and Data Mining)”).  Then enter the name and location to save the new project, and that is all that is too it.

This feature has also helped me once when I checked out a project from source control, made a bunch of changes, deployed those changes, then accidentally pulled the project again from source control, wiping out my changes.  I “reverse engineered” it and got the changes back: when I built the project from the cube on the server I then copied the resulting project files and overwrote the TFS “checked out” files.  Then I checked those files into TFS.

There is another feature called “online mode” that you can use if you want to make a change to the SSAS database, but don’t want to create a project.  In this mode, you connect to the cube without saving any local files.  Any changes you make are made directely to the SSAS database.  To do this, in Visual Studio go to the menu File -> Open -> Analysis Services Database… -> “Connect to existing database” (or create a new one).  I can’t think of many reasons why you would want to use online mode, except maybe if you need to make a quick change to a cube and don’t have the time to create a project and deploy the cube.

About James Serra

James is a big data and data warehousing solution architect at Microsoft. Previously he was an independent consultant working as a Data Warehouse/Business Intelligence architect and developer. He is a prior SQL Server MVP with over 25 years of IT experience.
This entry was posted in SQLServerPedia Syndication, SSAS, Visual Studio 2008. Bookmark the permalink.

14 Responses to Building a Visual Studio project from an existing SSAS database

  1. Tobi says:

    Old article but still solved my problem.
    So easy and kind of obvious but who cares for options which are provided in a menu.
    Any how.
    Thanks alot

  2. Kamakshi Suram says:

    Thank you so much. It worked for me.

  3. Yuval Dror says:

    Excellent tip Thank a lot !

  4. Jun Dou says:

    I think this is the second time I searched and found this article, thanks for the posting.

  5. Doug Brashear says:

    Great post! It solved my problem.

  6. Venkata Vempati says:

    Great Post! It worked for me.

  7. Daniel King says:

    Great post, really helpful.

    We have just implemented dynamic partitions in our tabular model. The Visual Studio project was wiping these partitions out every time one of the team deployed.

    Further to this post, is there any way to automate this “reverse engineering” process to keep our development project up to date with the latest partition structure?

  8. Sam says:

    I created the project like you mentioned. However, I do import the cubes, measures and dimensions. Thanks!

  9. Sam says:

    The previous post meant to say, how do I import the cubes, measures and dimensions. My end goal is to see what tables and fields the cube and measures are based on.

  10. Prayag says:

    Thanks a lot 🙂

  11. Robin Krupp says:

    cubes are dead.

  12. Douglas says:

    Thanks for this post!

    @Robin Krupp, have you tried turning them off and on again?

  13. Junaid says:

    I was in the same situation and the article helped me to get cube source from DB.

  14. Marko says:

    Sir, you have saved my life!!!!!
    thank you! thank you so much!