다음을 통해 공유


Clone (Dimension Interface)

[!참고]   이 기능은 다음 버전의 Microsoft SQL Server에서 제거됩니다. 새 개발 작업에서는 이 기능을 사용하지 말고, 현재 이 기능을 사용하는 응용 프로그램은 가능한 한 빨리 수정하십시오.

The Clone method of the Dimension interface copies the properties and levels of an existing object to a target object of the same class type.

Applies To: clsDatabaseDimension

구문

object.Clone(ByVal TargetObject As Dimension, [ByVal Options As CloneOptions = cloneMajorChildren])

주의

  • object
    The Dimension object whose properties and levels are to be copied.
  • TargetObject
    A previously created object of the same class type.
  • Options
    The options to tell the method to what extent the source object should be duplicated. If no value is specified, the cloneMajorChildren option is used.

주의

The following values for Options are valid for cloning a dimension.

Clone option Description

cloneObjectProperties

The values of the properties of the source dimension are copied to the target dimension

cloneMinorChildren

The values of the properties and levels contained in the source dimension are copied to the target dimension

cloneMajorChildren

For dimension objects, this is the same as cloneMinorChildren

The following example copies the properties and levels of dimension DimA to dimension DimB:

    Dim dsoServer As New DSO.Server
    Dim dsoDB As DSO.MDStore
    Dim dsoDimA As DSO.Dimension
    Dim dsoDimB As DSO.Dimension
    
    ' Connect to local Analysis server.
    dsoServer.Connect "LocalHost"
    
    ' Open the FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")
    
    ' Create a new dimension, named DimA, to be used
    ' as a source dimension from which to clone.
    Set dsoDimA = dsoDB.Dimensions.AddNew("DimA")
    dsoDimA.Description = "First dimension"
    
    ' Create the target dimension, named DimB, and
    ' give it a different description.
    Set dsoDimB = dsoDB.Dimensions.AddNew("DimB")
    dsoDimB.Description = "Second dimension"
    
    ' Now, clone the DimA dimension into DimB.
    dsoDimA.Clone dsoDimB, cloneMajorChildren
    
    ' Print the description of the DimB dimension
    ' to the Debug window.
    Debug.Print dsoDimB.Description

참고 항목

참조

Dimension Interface

도움말 및 정보

SQL Server 2005 지원 받기