Condividi tramite


Classe Variables

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

Gerarchia di ereditarietà

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

Spazio dei nomi  Microsoft.SqlServer.Dts.Runtime
Assembly:  Microsoft.SqlServer.ManagedDTS (in Microsoft.SqlServer.ManagedDTS.dll)

Sintassi

'Dichiarazione
Public NotInheritable Class Variables _
    Inherits DTSReadOnlyCollectionBase
'Utilizzo
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

Nel tipo Variables sono esposti i membri seguenti.

Proprietà

  Nome Descrizione
Proprietà pubblica Count Gets the number of elements contained in the DTSReadOnlyCollectionBase instance. Ereditato da DTSReadOnlyCollectionBase.
Proprietà pubblica IsSynchronized Gets a value that indicates whether access to the DTSReadOnlyCollectionBase is synchronized (thread-safe). Ereditato da DTSReadOnlyCollectionBase.
Proprietà pubblica Item Returns a Variable object from the Variables collection.
Proprietà pubblica Locked A Boolean indicating whether the variables in the Variables collection are locked.
Proprietà pubblica SyncRoot Gets an object that can be used to synchronize access to the DTSReadOnlyCollectionBase. Ereditato da DTSReadOnlyCollectionBase.

In alto

Metodi

  Nome Descrizione
Metodo pubblico Add Adds a Variable object to the Variables collection.
Metodo pubblico Contains Returns a Boolean that indicates whether the items in the collection can be accessed by using indexing without throwing an exception.
Metodo pubblico CopyTo Copies the entire DTSReadOnlyCollectionBase to a compatible one-dimensional array, starting at the specified index of the target array. Ereditato da DTSReadOnlyCollectionBase.
Metodo pubblico Equals Ereditato da Object.
Metodo pubblico GetEnumerator Returns a VariableEnumerator enumerator for use in iterating over the Variables collection.
Metodo pubblico GetHashCode Ereditato da Object.
Metodo pubblico GetType Ereditato da Object.
Metodo pubblico Join Joins the Variable to the Variables collection.
Metodo pubblico Remove Removes a Variable object from the Variables collection.
Metodo pubblico ToString Ereditato da Object.
Metodo pubblico Unlock Releases the locks on the variables collection and flags the state of the variables collection as invalid or unknown.

In alto

Osservazioni

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 Utilizzo di variabili nei pacchetti.

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.

Nota importanteImportante

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.

Protezione dei thread

I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.

Vedere anche

Riferimento

Spazio dei nomi Microsoft.SqlServer.Dts.Runtime