DTSTransactionOption 列挙型

定義

トランザクションをサポート可能かどうかと、コンテナーがトランザクションに参加するかどうかを表します。

public enum class DTSTransactionOption
public enum DTSTransactionOption
type DTSTransactionOption = 
Public Enum DTSTransactionOption
継承
DTSTransactionOption

フィールド

NotSupported 0

このコンテナーではトランザクションが開始されないことと、その結果、親コンテナーで開始されたトランザクションがある場合に、その現在のトランザクションの結果によって、このコンテナーの実行中に変更されるデータが影響を受けないことを示します。 これは、親コンテナーがトランザクションを開始した場合でも、変更がロールバックされないことを意味します。

Required 2

親コンテナーが既にトランザクションを開始していない限り、このコンテナーで新しいトランザクションが開始されることを意味します。親コンテナーが既にトランザクションを開始している場合は、親のトランザクションが結合されます。

Supported 1

このコンテナーがトランザクションを開始しないことを示します。 ただし、親コンテナーがトランザクションを開始している場合は、そのトランザクションに参加します。 これは既定値です。

次のコード例は、この列挙を使用して Package.TransactionOption の値を変更する方法を示します。

using System;  
using System.Collections.Generic;  
using System.Text;  
using Microsoft.SqlServer.Dts.Runtime;  

namespace Microsoft.SqlServer.SSIS.Samples  
{  
    class Program  
    {  
        static void Main(string[] args)  
        {  
            Application app = new Application();  
            Package pkg = new Package();  

            // Display the default value of TransactionOption.  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption);  

            // Modify the value.  
            pkg.TransactionOption = DTSTransactionOption.Required;  

            // Display the new value of TransactionOption.  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption);  
        }  
    }  
}  
Imports System  
Imports System.Collections.Generic  
Imports System.Text  
Imports Microsoft.SqlServer.Dts.Runtime  

Namespace Microsoft.SqlServer.SSIS.Samples  
    Class Program  
        Shared  Sub Main(ByVal args() As String)  
            Dim app As Application =  New Application()   
            Dim pkg As Package =  New Package()   

            ' Display the default value of TransactionOption.  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption)  

            ' Modify the value.  
            pkg.TransactionOption = DTSTransactionOption.Required  

            ' Display the new value of TransactionOption.  
            Console.WriteLine("TransactionOption:    {0}", pkg.TransactionOption)  
        End Sub  
    End Class  
End Namespace  

サンプル出力:

TransactionOption: サポートされています

TransactionOption: 必須

注釈

この列挙は、コンテナーがトランザクションに参加するかどうかを示すために、コンテナーによって使用されます。

適用対象