ForEachVariableMapping.ID 속성
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
변수에 할당된 고유 ID를 포함하는 String을 가져옵니다. 이는 일반적으로 GUID입니다. 이 속성은 읽기 전용입니다.
public:
property System::String ^ ID { System::String ^ get(); };
[Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "IDDesc")]
public string ID { get; }
[<Microsoft.SqlServer.Dts.Runtime.Localization.LocalizablePropertyDescription(typeof(Microsoft.SqlServer.Dts.Runtime.Localized), "IDDesc")>]
member this.ID : string
Public ReadOnly Property ID As String
속성 값
고유 ID(일반적으로 GUID)를 포함하는 문자열입니다.
구현
- 특성
예제
다음 코드 예제에서는 만들고ForEachVariableMapping, 읽기-쓰기 속성을 설정하고, 읽기 전용 속성을 보고, 및 ValueIndex 속성을 사용하여 매핑을 VariableName 설정합니다.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Runtime.Enumerators;
using Microsoft.SqlServer.Dts.Runtime.Enumerators.Item;
namespace Microsoft.SqlServer.SSIS.Samples
{
class Program
{
public static void Main()
{
// Create the new application and package.
Application app = new Application();
Package package = new Package();
// Create ForEachLoop task
Executables executables = package.Executables;
ForEachLoop forEachLoop = executables.Add("STOCK:FOREACHLOOP") as ForEachLoop;
// Create a VariableMappings and VariableMapping objects.
ForEachVariableMappings forEachVariableMappings = forEachLoop.VariableMappings;
ForEachVariableMapping forEachVariableMapping = forEachVariableMappings.Add();
// Set the properties.
forEachVariableMapping.Description = "My ForEach Variable Mapping";
forEachVariableMapping.Name = "My Name is ForEachVariableMapping";
// View the read-only properties. CreationName can be blank.
Console.WriteLine("ID: {0}", forEachVariableMapping.ID);
Console.WriteLine("CreationName: {0}", forEachVariableMapping.CreationName);
// Create a mapping between the variable and its value.
forEachVariableMapping.VariableName = @"Id";
forEachVariableMapping.ValueIndex = 0;
// Add other tasks to ForEachLoop container.
//...
// Run the package when the rest of the code is finished.
DTSExecResult status = package.Execute();
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Runtime.Enumerators
Imports Microsoft.SqlServer.Dts.Runtime.Enumerators.Item
Namespace Microsoft.SqlServer.SSIS.Samples
Class Program
Public Shared Sub Main()
' Create the new application and package.
Dim app As New Application()
Dim package As New Package()
' Create ForEachLoop task
Dim executables As Executables = package.Executables
Dim forEachLoop As ForEachLoop = CType(executables.Add("STOCK:FOREACHLOOP"), ForEachLoop)
' Create a VariableMappings and VariableMapping objects.
Dim forEachVariableMappings As ForEachVariableMappings = forEachLoop.VariableMappings
Dim forEachVariableMapping As ForEachVariableMapping = forEachVariableMappings.Add()
' Set the properties.
forEachVariableMapping.Description = "My ForEach Variable Mapping"
forEachVariableMapping.Name = "My Name is ForEachVariableMapping"
' View the read-only properties. CreationName can be blank.
Console.WriteLine("ID: {0}", forEachVariableMapping.ID)
Console.WriteLine("CreationName: {0}", forEachVariableMapping.CreationName)
' Create a mapping between the variable and its value.
forEachVariableMapping.VariableName = "Id"
forEachVariableMapping.ValueIndex = 0
Console.WriteLine()
' Add other tasks to ForEachLoop container.
'...
' Run the package when the rest of the code is finished.
Dim status As DTSExecResult = package.Execute()
End Sub 'Main
End Class 'Program
End Namespace 'Microsoft.SqlServer.SSIS.Samples
샘플 출력:
ID: {DDCF34B7-853F-4013-B924-93D1A00DEC3F}
CreationName: