Modifying a cube partition with code

  • I'm trying to modify a cube partition with code from visual basic .net but i can´t find a way, it seems that you just can drop the existing partition and then create it.

    Anyone knows something about it?

    Thanks in advance.

  • You should be able to do this but you may run in to a problem if you have only 1 partition. From memory it will let you drop partitons as long as it's not the last/only partition. If you only have one, maybe code around this by adding the new partition then dropping the existing, all you'll need to do is add it with a different/unique ID (and preferably name too).

    Steve.

  • sorry, misread your post - what changes are you looking to make to the partition that it won't let you make?

    Steve.

  • Thank you for replying.

    I have 25 partitions and i want to make a modification (add some fields or conditions) but it's the same for all so it can be (at least that's what i think) dinamically for all of them. I've just find code to drop and create partitions, but not to modify, that's what i'm looking for.

  • So for example, you'd like to change the source table that is 'feeding' a partition? or the query (if it's not a table direct feed)? If you access the partition object via the MeasureGroup (parent) object (it has a collection, so MyMeasureGroup.Partitions("somepartitionname_or_ID") will return that partition. Alternatively you could cycle through them using a foreach statement. Once you've got the partition object you can definitely change quite a few of it's properties.

    Just note that all of the above is assuming you're running Analysis Services 2005.

    Steve.

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply