Variables 类

Contains a collection of Variables objects, which are accessed through several objects. This class cannot be inherited.

继承层次结构

System. . :: . .Object
  Microsoft.SqlServer.Dts.Runtime. . :: . .DTSReadOnlyCollectionBase
    Microsoft.SqlServer.Dts.Runtime..::..Variables

命名空间:  Microsoft.SqlServer.Dts.Runtime
程序集:  Microsoft.SqlServer.ManagedDTS(在 Microsoft.SqlServer.ManagedDTS.dll 中)

语法

声明
Public NotInheritable Class Variables _
    Inherits DTSReadOnlyCollectionBase
用法
Dim instance As Variables
public sealed class Variables : DTSReadOnlyCollectionBase
public ref class Variables sealed : public DTSReadOnlyCollectionBase
[<SealedAttribute>]
type Variables =  
    class
        inherit DTSReadOnlyCollectionBase
    end
public final class Variables extends DTSReadOnlyCollectionBase

Variables 类型公开以下成员。

属性

  名称 说明
公共属性 Count Gets the number of elements contained in the DTSReadOnlyCollectionBase instance. (从 DTSReadOnlyCollectionBase 继承。)
公共属性 IsSynchronized Gets a value that indicates whether access to the DTSReadOnlyCollectionBase is synchronized (thread-safe). (从 DTSReadOnlyCollectionBase 继承。)
公共属性 Item Returns a Variable object from the Variables collection.
公共属性 Locked A Boolean indicating whether the variables in the Variables collection are locked.
公共属性 SyncRoot Gets an object that can be used to synchronize access to the DTSReadOnlyCollectionBase. (从 DTSReadOnlyCollectionBase 继承。)

页首

方法

  名称 说明
公共方法 Add Adds a Variable object to the Variables collection.
公共方法 Contains Returns a Boolean that indicates whether the items in the collection can be accessed by using indexing without throwing an exception.
公共方法 CopyTo Copies the entire DTSReadOnlyCollectionBase to a compatible one-dimensional array, starting at the specified index of the target array. (从 DTSReadOnlyCollectionBase 继承。)
受保护方法 CreateManagedObject 基础结构。 (从 DTSReadOnlyCollectionBase 继承。)
公共方法 Equals (从 Object 继承。)
受保护方法 Finalize (从 Object 继承。)
受保护方法 GetCount 基础结构。 (从 DTSReadOnlyCollectionBase 继承。)
公共方法 GetEnumerator Returns a VariableEnumerator enumerator for use in iterating over the Variables collection.
公共方法 GetHashCode (从 Object 继承。)
受保护方法 GetManagedEnumerator 基础结构。 (从 DTSReadOnlyCollectionBase 继承。)
公共方法 GetType (从 Object 继承。)
受保护方法 MemberwiseClone (从 Object 继承。)
公共方法 Remove Removes a Variable object from the Variables collection.
公共方法 ToString (从 Object 继承。)
公共方法 Unlock Releases the locks on the variables collection and flags the state of the variables collection as invalid or unknown.

页首

字段

  名称 说明
受保护字段 m_unmanagedColl 基础结构。 (从 DTSReadOnlyCollectionBase 继承。)

页首

注释

Integration Services (SSIS) provides system variables and supports custom user variables. When you create a new package, add a container or a task to the package, or create an event handler, SSIS automatically includes a set of system variables for the item. System variables are always located in the System namespace. System variables contain useful information about the package and its containers, tasks, and event handlers. System variables contain information such as the name of the computer on which the package runs and the time the package starts. You can view the information that is contained in a system variable, but you cannot add to or update system variables.

You can also create custom variables for use in packages, containers, tasks, transformations, and precedence constraints. Custom variables can be created in the User namespace or a namespace of your choice. Custom variables can be used in the expressions that the For Loop container, the Derived Column transformation, the Conditional Split transformation, and precedence constraints may contain. For more information, see 在包中使用变量.

Every container in the SSIS object model has a Variables collection. This collection is accessible to each child of the container. A variable is accessed from the collection by using its name or its index. The Variables collection on a container represents an aggregation of the variables in the collection of its parent. The Variables collection of the Package class is visible to all objects in the package, providing a globally visible collection. Conversely, the variables contained in a task are limited in scope and visibility, and are only visible by the task.

重要说明重要提示

The Variables is used with the Runtime classes. If you are using data flow components (Microsoft.SqlServer.Dts.Pipeline), you may be required to use the IDTSVariables100. To know which variables collection to use, see the documentation for the object you are acquiring variables on, and verify the return value.

线程安全

此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。