DTSTransactionOption 枚举

Describes transaction supportability and specifies whether a container participates in transactions.

命名空间:  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 Specifies that no transaction will be started for this container, and consequently, the outcome of the current transaction, if one has been started by a parent container, will not affect the data that may be altered during execution of this container. This means that changes will not roll back, even if the parent container started a transaction.
Supported Specifies that this container will not start a transaction. However, it will participate in a transaction if the parent container started one. This is the default.
Required Specifies that this container will cause a new transaction to be started unless the parent container already has a transaction, in which case, the parent’s transaction will be joined.

注释

This enumeration is used by containers to indicate whether the container participates in transactions.

示例

The following code example shows the use of this enumeration to change the value of the 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

Sample Output:

TransactionOption: Supported

TransactionOption: Required