2.8.4 VariableType

The VariableType complex type is used to specify variables that are available to the package. The variables are evaluated at run time. 

The following is the XSD of the VariableType complex type.

   <xs:complexType name="VariableType">
     <xs:sequence>
       <xs:element name="Property"
                   maxOccurs="unbounded">
         <xs:complexType>
           <xs:complexContent>
             <xs:extension base="DTS:PropertyElementBaseType">
               <xs:attribute name="Name"
                   type="DTS:VariablePropertyNameEnum"
                   use="required"/>
             </xs:extension>
           </xs:complexContent>
         </xs:complexType>
       </xs:element>
       <xs:element name="PropertyExpression"
                   type="DTS:PropertyExpressionElementType"
                   minOccurs="0" maxOccurs="unbounded"/>
       <xs:element name="VariableValue">
         <xs:complexType mixed="true">
           <xs:sequence>
             <xs:any minOccurs="0" maxOccurs="unbounded" processContents="skip"/>
           </xs:sequence>
           <xs:attribute name="DataType" type="DTS:DtsDataTypeEnum"/>
           <xs:attribute name="DataSubType">
             <xs:simpleType>
               <xs:restriction base="xs:string">
                 <xs:enumeration value="ManagedSerializable"/>
               </xs:restriction>
             </xs:simpleType>
           </xs:attribute>
         </xs:complexType>
       </xs:element>
     </xs:sequence>
   </xs:complexType>

The following table provides additional information about the elements, types, and constraints for the VariableType complex type.

Element

Additional constraints

Type definition

Description

Property

In some cases, constraints are placed on the Property element’s value for specific values of the Name attribute of the Property element. If such constraints exist, they are specified where the meaning of the particular property name is specified. These constraints MUST be followed. If the optional DataType attribute is present, the value of the Property element MUST be of the type that is specified by the DataType attribute.

Inline in the XSD in this section.

Property elements contain values for many different properties associated with an instance of the containing Executable element, according to the Name attribute of each Property element.

PropertyExpression

Additional constraints exist for the PropertyExpression element. These constraints MUST be followed. For a description of the constraints, see PropertyExpressionElementType.

PropertyExpressionElementType

The PropertyExpression element serves the same purpose as specified for the Property element, except that an expression that is evaluated at run time is contained in the element’s value that is stored in the Microsoft SQL Server Integration Services (SSIS) file format.

VariableValue

If the optional DataType attribute is included, the value of the element MUST be of the type that is specified by the DataType attribute. If the optional DataSubType attribute is included, the VariableValue element can contain complex content.

Contains the value that is used literally or is evaluated as an expression.

The following table provides additional information about the attributes and types for the Property element that is declared inline in the complex type declaration. The Property element is an extension of the PropertyElementBaseType type with the addition of the Name attribute. This attribute is specified in the following table.

Attribute

Description

Name

Specifies the name of the Property element. Each named property has its own use and interpretation. The explanation for the interpretation of each named property is given with the definition of the type for the Name attribute.

The following table specifies the enumeration values for the VariableType type.

Enumeration value

Description

ManagedSerializable

Specifies a managed and serializable object that can be serialized as XML in a DTSX file. This is the only valid value for the DataSubType attribute.