Merge (MDStore Interface)
[!참고] 이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.
The Merge method of the MDStore interface merges two partitions into a single partition. The partitions must have the same aggregations and storage modes.
Applies To:clsPartition
구문
object.Merge(ByVal SourceName As String)
매개 변수
- object
The partition object into which to merge the source partition object.
- SourceName
A string that contains the name of the source partition object.
주의
Before merging two partitions that specify data slices, you must first set the slice of the receiving partition to the slice that will apply after the merge has been completed. Otherwise, the partitions will not be successfully merged. The slice for the receiving partition must be the parent of the first level, where the slice values for the two partitions differ.
For example, if you are merging a partition that contains data based on the slice [AllTime].[1998].[Quarter2] into a partition that contains [AllTime].[1998].[Quarter1], the target partition's slice must be set to the parent of the two slices that differ, in this case [AllTime].[1998]. The target partition's slice must be set to this value before merging the partitions. For more information, see Managing Partitions and Merging Partitions.
[!참고] This adjustment is done automatically when you merge partitions using the Analysis Manager user interface.
Examples
The following code prepares two partitions for a merge by merging the data slice values so they are equal:
Sub MergeDataSlices(SourcePart As DSO.MDStore, _
TargetPart As DSO.MDStore)
' This example code merges the data slices of two partitions.
' This subroutine does not merge the partitions; instead,
' it compares the source and target partitions, changing
' the target partition to match the source partition to
' prepare it for merging.
Dim dsoDimSource As DSO.Dimension
Dim dsoLevelSource As DSO.Level
Dim dsoDimTarget As DSO.Dimension
Dim dsoLevelTarget As DSO.Level
Dim nDim As Integer, nLev As Integer, nLev2 As Integer
' Search for the first level where the slice differs.
' Then use the parent level just above it.
' Loop through each dimension in the source partition.
For nDim = 1 To SourcePart.Dimensions.Count
Set dsoDimSource = SourcePart.Dimensions(nDim)
Set dsoDimTarget = TargetPart.Dimensions(nDim)
' For each source and target dimension, compare the two
' and find the first level where the data slice differs.
For nLev = 1 To dsoDimSource.Levels.Count
Set dsoLevelSource = dsoDimSource.Levels(nLev)
Set dsoLevelTarget = dsoDimTarget.Levels(nLev)
If dsoLevelSource.SliceValue <> dsoLevelTarget.SliceValue Then
' Clear the slice values for all of the levels below
' in the target partition.
For nLev2 = nLev To dsoDimSource.Levels.Count
Set dsoLevelTarget = dsoDimTarget.Levels(nLev2)
dsoLevelTarget.SliceValue = ""
Next
' Stop looping through levels.
Exit For
End If
Next
Next
' Now that the target partition is ready for merge,
' update it.
TargetPart.Update
End Sub
참고 항목
참조
MDStore Interface
UnlockObject (MDStore Interface)