DTSTransactionOption 列挙型

定義

トランザクションの対応可能性を記述し、コンテナがトランザクションに参加するかどうかを指定します。

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

フィールド

名前 説明
NotSupported 0

このコンテナに対してトランザクションは開始されず、したがって、親コンテナによってトランザクションが開始された場合、現在のトランザクションの結果は、実行中に変更される可能性のあるデータには影響しません。 つまり、親コンテナがトランザクションを開始していても、変更はロールバックされません。

Supported 1

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

Required 2

このコンテナが新しいトランザクションを開始することを指定します。ただし、親コンテナにすでにトランザクションがある場合、親コンテナのトランザクションが結合されます。

以下のコード例は、この列挙を使って 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  

出力例:

トランザクションオプション:サポート済み

トランザクションオプション:必須

注釈

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

適用対象