OrdinalPosition (Command Interface)

ms134819.note(de-de,SQL.90).gifHinweis:
  Dieses Feature wird in der nächsten Version von Microsoft SQL Server entfernt. Verwenden Sie dieses Feature nicht zum Entwickeln neuer Anwendungen, und planen Sie das Ändern von Anwendungen, in denen es zurzeit verwendet wird, zum frühstmöglichen Zeitpunkt ein.

The OrdinalPosition property of the Command interface contains the ordinal position of a command in the Commands collection in the parent MDStore object.

Applies To:clsCubeCommand, clsDatabaseCommand, clsRoleCommand

Data Type

Integer

Access

Read-only

Hinweise

Ordinal position determines the order in which commands are executed. This order is important when one command depends on another command (for example, a CREATE SET command that uses a member defined in a CREATE MEMBER command). In this case, the CREATE MEMBER command should have a lower OrdinalPosition property value than the CREATE SET command. However, the ordinal position of the command does not affect the solve order of the calculated member or calculated cells definition the command may create. For more information on how solve order affects calculated cells and calculated members, see Understanding Pass Order and Solve Order.

Beispiel

The following code creates three new commands in the Commands collection of the FoodMart 2000 database. It then enumerates the collection, printing the OrdinalPosition and Name properties to the Debug window. Then, the code example deletes and re-creates the first command, and again enumerates the collection to demonstrate the change in ordinal position on the other commands.

    Dim dsoServer As New DSO.Server
    Dim dsoDB As DSO.MDStore
    Dim dsoCmd As DSO.Command
    
    ' Connect to the local Analysis server.
    dsoServer.Connect "LocalHost"
    
    ' Open the FoodMart 2000 database.
    Set dsoDB = dsoServer.MDStores("FoodMart 2000")
    
    ' Add three sample commands.
    Set dsoCmd = dsoDB.Commands.AddNew("Command3")
    Set dsoCmd = dsoDB.Commands.AddNew("Command1")
    Set dsoCmd = dsoDB.Commands.AddNew("Command2")
    
    ' Iterate through the commands for the database.
    For Each dsoCmd In dsoDB.Commands
        ' Print its name and ordinal position
        Debug.Print dsoCmd.OrdinalPosition & " = " & dsoCmd.Name
    Next

    ' Now, delete the Command3 command and add it again.
    dsoDB.Commands.Remove "Command3"
    Set dsoCmd = dsoDB.Commands.AddNew("Command3")
    
    ' Iterate again through the commands for the database.
    Debug.Print "-----"
    For Each dsoCmd In dsoDB.Commands
        ' Print its name and ordinal position
        Debug.Print dsoCmd.OrdinalPosition & " = " & dsoCmd.Name
    Next

Siehe auch

Verweis

Command Interface

Andere Ressourcen

CREATE SET-Anweisung (MDX)
CREATE MEMBER-Anweisung (MDX)

Hilfe und Informationen

Informationsquellen für SQL Server 2005