次の方法で共有


DTSTransactionOption 列挙体

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

名前空間:  Microsoft.SqlServer.Dts.Runtime
アセンブリ:  Microsoft.SqlServer.ManagedDTS (Microsoft.SqlServer.ManagedDTS.dll)

構文

'宣言
Public Enumeration DTSTransactionOption
'使用
Dim instance As DTSTransactionOption
public enum DTSTransactionOption
public enum class DTSTransactionOption
type DTSTransactionOption
public enum DTSTransactionOption

メンバー

メンバー名 説明
NotSupported このコンテナではトランザクションが開始されないことと、その結果、親コンテナで開始されたトランザクションがある場合に、その現在のトランザクションの結果によって、このコンテナの実行中に変更されるデータが影響を受けないことを示します。これは、親コンテナがトランザクションを開始した場合でも、変更がロールバックされないことを意味します。
Supported このコンテナがトランザクションを開始しないことを示します。ただし、親コンテナがトランザクションを開始している場合は、そのトランザクションに参加します。これが既定の動作です。
Required 親コンテナが既にトランザクションを開始していない限り、このコンテナで新しいトランザクションが開始されることを意味します。親コンテナが既にトランザクションを開始している場合は、親のトランザクションが結合されます。

説明

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

使用例

次のコード例は、この列挙を使用して 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: Supported

TransactionOption: Required