Variable.SystemVariable 속성

정의

변수가 시스템 변수인지 여부를 나타내는 부울을 가져옵니다. 이 속성은 읽기 전용입니다.

public:
 property bool SystemVariable { bool get(); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "SystemVariableDesc")]
public bool SystemVariable { get; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "SystemVariableDesc")>]
member this.SystemVariable : bool
Public ReadOnly Property SystemVariable As Boolean

속성 값

변수가 시스템 변수인지 여부를 나타내는 부울입니다. 값이 true이면 변수가 시스템 변수라는 의미입니다. 값이 false이면 변수가 사용자 변수 또는 사용자 지정 변수이며 System 네임스페이스에 포함되지 않는다는 의미입니다.

특성

예제

다음 예제에서는 패키지를 만들고, 추가 ForEachLoop하며, 변수를 컬렉션에 VariablesForEachLoop추가합니다. 그런 다음 변수의 속성을 검색하고 설정하며, 보기에 표시합니다(예: .) SystemVariable.

static void Main(string[] args)  
        {  
            Package p = new Package();  
            // Add a sequence to the package executables collection  
            Sequence seq = (Sequence)p.Executables.Add("STOCK:SEQUENCE");  
            // Add a ForEachLoop to the Sequence  
            ForEachLoop feLoop = (ForEachLoop)seq.Executables.Add("STOCK:FOREACHLOOP");  

            // Add a variable, v, to the variable collection  
           // of the ForEach loop.  
            Variable v = feLoop.Variables.Add("v", false, "global", 100);  

//  Get and set different variable properties  

            // Creation Name (read-only)  
            String createName = v.CreationName;  

            // Description (read/write)  
            v.Description = "my new v Description";  
            String vDesc = v.Description;  

            // ID (read-only)  
            String vID = v.ID;  

            // Name (read/write)  
            String oldName = v.Name;  
            v.Name = "my_new_V_name";  
            String newName = v.Name;  

            // Namespace (read/write)  
            String oldNamespace = v.Namespace;  
            v.Namespace = "my_new_v_Namespace";  
            String newNamespace = v.Namespace;  

            // Properties (read-only)  
            int pmCount = v.Properties.Count;  

            // Qualified Name (read-only)  
            String QName = v.QualifiedName;  

            // RaiseChangedEvent (read/write)  
            Boolean oldraiseChEvt = v.RaiseChangedEvent;  
            v.RaiseChangedEvent = true;  
            Boolean raiseChangedEvent = v.RaiseChangedEvent;  

            // Read-only (read/write)  
            Boolean vReadOnly = v.ReadOnly;  
            v.ReadOnly = true;  
            Boolean newVReadOnly = v.ReadOnly;  

            // System Variable (read-only)  
            Boolean sysVar = v.SystemVariable;  

            // Type (read-only)  
            TypeCode type = v.DataType;  

            // Value (read/write)  
            Object vValue = v.Value;  

            Console.WriteLine("The variable properties are: ");  
            Console.WriteLine("Creation Name   = {0}", createName);  
            Console.WriteLine("Description        = {0}", vDesc);  
            Console.WriteLine("ID                     = {0}", vID);  
            Console.WriteLine("Old name, new name = {0}, {1}", oldName, newName);  
            Console.WriteLine("Old namespace, new namespace = {0}, {1}", oldNamespace, newNamespace);  
            Console.WriteLine("Properties count   = {0}", pmCount);  
            Console.WriteLine("Qualified Name     = {0}", QName);  
            Console.WriteLine("old RaiseEvent, new RaiseEvent = {0}, {1}", oldraiseChEvt, raiseChangedEvent);  
            Console.WriteLine("old read-only, new read-only = {0}, {1}", vReadOnly, newVReadOnly);  
            Console.WriteLine("System Variable    = {0}", sysVar);  
            Console.WriteLine("Type               = {0}", type);  
        }  
Shared Sub Main(ByVal args() As String)   
    Dim p As New Package()  
    ' Add a sequence to the package executables collection  
    Dim seq As Sequence = CType(p.Executables.Add("STOCK:SEQUENCE"), Sequence)  
    ' Add a ForEachLoop to the Sequence  
    Dim feLoop As ForEachLoop = CType(seq.Executables.Add("STOCK:FOREACHLOOP"), ForEachLoop)  

    ' Add a variable, v, to the variable collection  
    ' of the ForEach loop.  
    Dim v As Variable = feLoop.Variables.Add("v", False, "global", 100)  

    '  Get and set different variable properties  
    ' Creation Name (read-only)  
    Dim createName As String = v.CreationName  

    ' Description (read/write)  
    v.Description = "my new v Description"  
    Dim vDesc As String = v.Description  

    ' ID (read-only)  
    Dim vID As String = v.ID  

    ' Name (read/write)  
    Dim oldName As String = v.Name  
    v.Name = "my_new_V_name"  
    Dim newName As String = v.Name  

    ' Namespace (read/write)  
    Dim oldNamespace As String = v.Namespace  
    v.Namespace = "my_new_v_Namespace"  
    Dim newNamespace As String = v.Namespace  

    ' Properties (read-only)  
    Dim pmCount As Integer = v.Properties.Count  

    ' Qualified Name (read-only)  
    Dim QName As String = v.QualifiedName  

    ' RaiseChangedEvent (read/write)  
    Dim oldraiseChEvt As [Boolean] = v.RaiseChangedEvent  
    v.RaiseChangedEvent = True  
    Dim raiseChangedEvent As [Boolean] = v.RaiseChangedEvent  

    ' Read-only (read/write)  
    Dim vReadOnly As [Boolean] = v.ReadOnly  
    v.ReadOnly = True  
    Dim newVReadOnly As [Boolean] = v.ReadOnly  

    ' System Variable (read-only)  
    Dim sysVar As [Boolean] = v.SystemVariable  

    ' Type (read-only)  
    Dim type As TypeCode = v.DataType  

    ' Value (read/write)  
    Dim vValue As [Object] = v.Value  

    Console.WriteLine("The variable properties are: ")  
    Console.WriteLine("Creation Name   = {0}", createName)  
    Console.WriteLine("Description        = {0}", vDesc)  
    Console.WriteLine("ID                     = {0}", vID)  
    Console.WriteLine("Old name, new name = {0}, {1}", oldName, newName)  
    Console.WriteLine("Old namespace, new namespace = {0}, {1}", oldNamespace, newNamespace)  
    Console.WriteLine("Properties count   = {0}", pmCount)  
    Console.WriteLine("Qualified Name     = {0}", QName)  
    Console.WriteLine("old RaiseEvent, new RaiseEvent = {0}, {1}", oldraiseChEvt, raiseChangedEvent)  
    Console.WriteLine("old read-only, new read-only = {0}, {1}", vReadOnly, newVReadOnly)  
    Console.WriteLine("System Variable    = {0}", sysVar)  
    Console.WriteLine("Type               = {0}", type)  
End Sub   

샘플 출력:

변수 속성은 다음과 같습니다.

만들기 이름 =

설명 = 내 새 v 설명

ID = {622CF328-55D7-4E81-9385-9C1F8450511E}

이전 이름, 새 이름 = v, my_new_V_name

이전 네임스페이스, 새 네임스페이스 = 전역, my_new_v_Namespace

속성 수 = 12

정규화된 이름 = my_new_v_Namespace::my_new_V_name

old RaiseEvent, new RaiseEvent = False, True

이전 읽기 전용, 새 읽기 전용 = False, True

시스템 변수 = False

형식 = Int32

설명

시스템 변수는 네임스페이스에 포함되고 System 패키지, 컨테이너 또는 태스크에 의해 생성된 변수입니다. System 변수는 실행 중에 편집할 수 없습니다.

적용 대상