Variables Class

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

命名空间: Microsoft.SqlServer.Dts.Runtime
程序集: Microsoft.SqlServer.ManagedDTS (in microsoft.sqlserver.manageddts.dll)

语法

声明
<DefaultMemberAttribute("Item")> _
Public NotInheritable Class Variables
    Inherits DTSReadOnlyCollectionBase
[DefaultMemberAttribute("Item")] 
public sealed class Variables : DTSReadOnlyCollectionBase
[DefaultMemberAttribute(L"Item")] 
public ref class Variables sealed : public DTSReadOnlyCollectionBase
/** @attribute DefaultMemberAttribute("Item") */ 
public final class Variables extends DTSReadOnlyCollectionBase
DefaultMemberAttribute("Item") 
public final class Variables extends DTSReadOnlyCollectionBase

备注

已更新的文本:2005 年 12 月 5 日

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.

ms213189.note(zh-cn,SQL.90).gif重要提示:
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 IDTSVariables90. To know which variables collection to use, see the documentation for the object you are acquiring variables on, and verify the return value.

Inheritance Hierarchy

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

线程安全

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

平台

开发平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

目标平台

有关支持的平台列表,请参阅安装 SQL Server 2005 的硬件和软件要求。

请参阅

参考

Variables Members
Microsoft.SqlServer.Dts.Runtime Namespace