Databases Reference
In-Depth Information
LISTING 26.3
The Syntax of the Alter Command
<Alter Scope=”Session” AllowCreate=”True”
ObjectExpansion=”ObjectProperties”>
<ParentObject>object_reference</ParentObject>
<ObjectDefinition>object_definition</ObjectDefinition>
</Alter>
Similar to the Create command, you specify the parent object for the object to be edited
by the Alter command, and then specify the definition of the object to be edited. When
Analysis Services receives an Alter command, it first analyzes which changes are necessary
for transformation of the object from the old state to the new one, and then performs
those changes.
You can specify three parameters on the Alter command: Scope , AllowCreate , and
ObjectExpansion . The Scope parameter alters cubes and dimensions on a session, so
changes to those objects will be available only to the user of the current session. To do
this, you specify the Scope=”Session” parameter on the Alter command. If you have not
specified this parameter, Analysis Services alters a server object so that the changes are
available to all the users that have access rights to that object.
You can use the AllowCreate parameter to tell the system to create an object if it doesn't
yet exist. In this case, Analysis Services treats the Alter command as a Create command.
If an object with the specified identifier already exists on the system, however, the Alter
command behaves differently from the Create command. In this case, instead of deleting
the old object and creating a new one with the same identifier and a version number of 1 ,
the Alter command creates a new version of the specified object and increments the
version number for that object. In addition, unlike the Create command, you might not
need to reprocess an object changed with the Alter command. For example, if you need
to change the name or description of the object, there is no need to reprocess the data
associated with that object.
The ObjectExpansion parameter defines the depth of the new definition for the object.
You can specify one of two values for this parameter in the Alter command:
. ObjectProperties —Indicates that the command is allowed to update only proper-
ties on the current object itself, without modifying any its child major objects. In
this case, ObjectProperties refers to the object's simple properties, such as Name or
Description , and its child minor objects.
. ExpandFull —Indicates that the command is allowed to update not just the current
object itself, but also all its child major and minor objects.
In Chapter 4, we discussed minor and major objects, and indicated that you can alter
minor objects only within the context of a change to the parent major object. The Alter
command, correspondingly, can alter a minor object, but only within the context of the
major object that contains it.
 
Search WWH ::




Custom Search