Public Sub Main()
Try
Dim strSplitMeasureGroup As String(), i As Integer, strCubeCommand As String
strSplitMeasureGroup = Split(Dts.Variables("User::varMeasureGroups").Value.ToString, ", ")
strCubeCommand = "<Batch xmlns=""http://schemas.microsoft.com/analysisservices/2003/engine"">"
For i = 0 To strSplitMeasureGroup.Length - 1
strCubeCommand = strCubeCommand & "<Process xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" "
strCubeCommand = strCubeCommand & "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" & Chr(13)
strCubeCommand = strCubeCommand & "<Object>" & Chr(13)
strCubeCommand = strCubeCommand & "<DatabaseID>myCube</DatabaseID>" & Chr(13)
strCubeCommand = strCubeCommand & "<CubeID>myCube</CubeID>" & Chr(13)
strCubeCommand = strCubeCommand & "<MeasureGroupID>" & strSplitMeasureGroup(i) & _
"</MeasureGroupID>" & Chr(13)
strCubeCommand = strCubeCommand & "</Object>" & Chr(13)
strCubeCommand = strCubeCommand & "<Type>ProcessFull</Type>" & Chr(13)
strCubeCommand = strCubeCommand & "<WriteBackTableCreation>UseExisting</WriteBackTableCreation>" & Chr(13)
strCubeCommand = strCubeCommand & "</Process>" & Chr(13)
Next
strCubeCommand = strCubeCommand & "</Batch>"
Dts.Variables("User::varCubeCommand").Value = strCubeCommand
Dts.Events.FireInformation(1, "", Dts.Variables("User::varCubeCommand").Value.ToString, "", 0, False)
Dts.TaskResult = Dts.Results.Success
Catch ex As Exception
Dts.Events.FireInformation(1, "", ex.Message, "", 0, False)
Dts.TaskResult = Dts.Results.Failure
End Try
End Sub
- Mohit Nayyar