AMO question
- From: "Jesse O." <jesperzz@xxxxxxxxxxx>
- Date: Thu, 20 Jul 2006 12:12:23 -0700
We use AMO to process our cubes. They're partitioned daily.
Everything works great with one exception. Let me explain.
We have 30 days to process. The first 20 days process fine. During the
processing of the 21st day an error occurs. The transaction rolls everything
back. This is not what we want...we want the first 20 days that processed
fine to commit.
My question is...how can this be done in AMO?
Example code:
Public Sub CreatePartition(ByRef sProcessingType, ByRef sNewPartitionName,
ByRef sCalendarDWID, ByRef sTimeOfDayDWID)
Dim oNewPartition As Partition
Dim oNewPartitionExists As Partition
Dim oClonePartition As Partition
Dim sQueryText As String
Dim sPartitionPrefix As String
Dim BeginTime As DateTime
Dim sSQLQuery As String
Try
oClonePartition = objMeasureGroup.Partitions.FindByName("template")
BeginTime = Now
InsertCubeProcessingLog("Process Partition Executing...", 0, 0, BeginTime,
"12/31/9999", objDatabase.Name, objCube.Name, objMeasureGroup.Name,
"Partition", sNewPartitionName, sQueryText, sProcessingType, sCalendarDWID,
sTimeOfDayDWID)
oNewPartition = oClonePartition.Clone
oNewPartition.ID = sNewPartitionName
oNewPartition.Name = sNewPartitionName
objMeasureGroup.Partitions.Add(oNewPartition)
oNewPartition.Source = New QueryBinding(objDatabase.DataSources(0).ID,
sQueryText)
oNewPartition.Update()
oNewPartition.Process(ProcessType.ProcessFull)
sSQLQuery = "set EventDescription = 'Process Partition', issuccess = 1,
recordactive = 1, eventendtime = '" & Now & "' where eventdescription =
'Process Partition Executing...' and eventendtime = '12/31/9999' and
eventstarttime = '" & BeginTime & "'" & " and partitionname = '" &
sNewPartitionName & "' and cubename = '" & objCube.Name & "' and objectname
= '" & objMeasureGroup.Name & "' and databasename = '" & objDatabase.Name &
"'"
UpdateCubeProcessingLog(sSQLQuery)
Catch
Dim ErrorReplace As String = Err.Description
ErrorReplace = ErrorReplace.Replace("'", "")
sSQLQuery = "set EventDescription = 'Process Partition Failed: " &
Err.Number & " - " & ErrorReplace & "', issuccess = 0, recordactive = 0,
eventendtime = '" & Now & "' where eventdescription = 'Process Partition
Executing...' and eventendtime = '12/31/9999' and eventstarttime = '" &
BeginTime & "'" & " and partitionname = '" & sNewPartitionName & "' and
cubename = '" & objCube.Name & "' and objectname = '" & objMeasureGroup.Name
& "' and databasename = '" & objDatabase.Name & "'"
UpdateCubeProcessingLog(sSQLQuery)
strKeepProcessing = "False"
End Try
End Sub
.
- Follow-Ups:
- Re: AMO question
- From: Darren Gosbell
- Re: AMO question
- From: Deepak Puri
- Re: AMO question
- Prev by Date: Re: ADOMD.NET + ASP.NET Web Application - A connection cannot be made
- Next by Date: SQL Server Analysis Services
- Previous by thread: Migrate Excel worksheets form SSAS 2000 to SSAS 2005
- Next by thread: Re: AMO question
- Index(es):
Relevant Pages
|