CheckpointUsage 屬性

Gets or sets a value that specifies if or when a package is restarted.

命名空間:  Microsoft.SqlServer.Dts.Runtime
組件:  Microsoft.SqlServer.ManagedDTS (在 Microsoft.SqlServer.ManagedDTS.dll 中)

語法

'宣告
Public Property CheckpointUsage As DTSCheckpointUsage
    Get
    Set
'用途
Dim instance As Package
Dim value As DTSCheckpointUsage

value = instance.CheckpointUsage

instance.CheckpointUsage = value
public DTSCheckpointUsage CheckpointUsage { get; set; }
public:
property DTSCheckpointUsage CheckpointUsage {
    DTSCheckpointUsage get ();
    void set (DTSCheckpointUsage value);
}
member CheckpointUsage : DTSCheckpointUsage with get, set
function get CheckpointUsage () : DTSCheckpointUsage
function set CheckpointUsage (value : DTSCheckpointUsage)

屬性值

型別:Microsoft.SqlServer.Dts.Runtime. . :: . .DTSCheckpointUsage
A value from the DTSCheckpointUsage enumeration.

備註

The default value of this property is Never, which indicates that the package cannot be restarted. For more information about the use of checkpoints in a package, see 使用檢查點以重新啟動失敗的封裝.

範例

The following code example sets the CheckpointUsage property.

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

namespace Package_API
{
    class Program
    {
        static void Main(string[] args)
        {
                    Application app = new Application();
            Package pkg = new Package();
            pkg = app.LoadPackage(@"C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx", null);

            // Set the CheckpointUsage to IfExistts to force package to retart if
            // the file specified by the CheckpointFileName property is found.
            pkg.CheckpointUsage = DTSCheckpointUsage.IfExists;

            Console.WriteLine("Check for existing checkpoint file? {0}", pkg.CheckpointUsage);
        }
    }
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
 
Namespace Package_API
    Class Program
        Shared  Sub Main(ByVal args() As String)
                    Dim app As Application =  New Application() 
            Dim pkg As Package =  New Package() 
            pkg = app.LoadPackage("C:\Program Files\Microsoft SQL Server\100\Samples\Integration Services\Package Samples\CalculatedColumns Sample\CalculatedColumns\CalculatedColumns.dtsx", Nothing)
 
            ' Set the CheckpointUsage to IfExistts to force package to retart if
            ' the file specified by the CheckpointFileName property is found.
            pkg.CheckpointUsage = DTSCheckpointUsage.IfExists
 
            Console.WriteLine("Check for existing checkpoint file? {0}", pkg.CheckpointUsage)
        End Sub
    End Class
End Namespace

Sample Output:

Check for existing checkpoint file? IfExists