SSAS AMO Objects : Script to Create new partition in a Measure group

In AMO Script    when we have partition with some template ie  complete query with dummy dates  and for example it is named as myTemplatePartitionName_partialday 



//generate new partition creation script

// First identify the template partition and assign to a Partition object

                    AMO.Partition amoTemplatePartition = amoMeasureGroup.Partitions.FindByName(myTemplatePartitionName_partialday);
 
// clone that template to another patition Object
                    AMO.Partition amoNextPartition = amoTemplatePartition.Clone();
 
//  assign the prefdefined name and ID to the partition
                    amoNextPartition.ID = myNextPartitionName;
                    amoNextPartition.Name = myNextPartitionName;

Comments

Popular posts from this blog

SSAS : A connection cannot be made to redirector. Ensure that 'SQL Browser' service is running. (Microsoft.AnalysisServices.AdomdClient). + Solution

SSIS Error : Unable to infer the XSD from the XML file. The XML contains multiple namespaces