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.
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
Thank you so much. It worked for me.
Excellent tip Thank a lot !
I think this is the second time I searched and found this article, thanks for the posting.
Great post! It solved my problem.
Great Post! It worked for me.
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?
I created the project like you mentioned. However, I do import the cubes, measures and dimensions. Thanks!
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.
Thanks.
Thanks a lot 🙂
cubes are dead.
Thanks for this post!
@Robin Krupp, have you tried turning them off and on again?
I was in the same situation and the article helped me to get cube source from DB.
Sir, you have saved my life!!!!!
thank you! thank you so much!