Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Programatically creating cube partitions within visual studio bi project

I am building an SSAS multidimensional cube where I have to define more than 100 partitions since I am handling a huge volume of data. I want to automate creating these partitions within visual studio.

After searching i found a method to create partitions programmatically using AMO.net and C#, but these will create them directly inside the deployed cube, so when you need to edit anything in the cube within visual studio, it will require deploying the project and overwrite the existing database and remove all defined partitions.

Is there is a way to easily define a lot of partitions within visual studio (analysis project) not the deployed analysis database?

like image 846
Yahfoufi Avatar asked Jul 21 '26 23:07

Yahfoufi


1 Answers

You can perform changes to your cube, and then incorporate the changes into the your Analysis Service Tabular Model using the following steps:

  1. If not set, change your Workspace Retention value to Keep in Memory.
  2. In Visual Studio, right click your Model and select View Code.
  3. Run the code to create partitions on your workspace Cube.
  4. Then from SQL Server Analysis Studio right click your cube and do select Script > Script Database As > Create To > New Query Editor Window.
  5. Copy everything in the "model" property from the generated script.
  6. Paste it to the "model" property in your Model code.
  7. Open Model and process.
like image 51
Daniel Gimenez Avatar answered Jul 23 '26 17:07

Daniel Gimenez



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!