DTSExecResult 열거형
정의
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
작업 실행 결과를 설명하는 값을 제공합니다.
public enum class DTSExecResult
public enum DTSExecResult
type DTSExecResult =
Public Enum DTSExecResult
- 상속
-
DTSExecResult
필드
| Name | 값 | Description |
|---|---|---|
| Success | 0 | 이 임무는 성공적으로 진행되었다. (가치 = 0) |
| Failure | 1 | 태스크가 실패했습니다. (값 = 1) |
| Completion | 2 | 임무는 완수되었다. (값 = 2) |
| Canceled | 3 | 그 임무는 취소되었다. (가치 = 3) |
예제
다음 코드 예시는 패키지에서 열거를 DTSExecResult 사용하는 한 가지 방법을 보여줍니다. 클래스는 Package 이 열거를 메서드의 Execute 반환 값으로 사용하여 패키지의 성공 또는 실패 상태를 결정합니다.
using System;
using System.Collections.Generic;
using System.Text;
using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.SqlServer.Dts.Tasks.ScriptTask;
namespace Package_API
{
class Program
{
static void Main(string[] args)
{
Package p = new Package();
p.InteractiveMode = true;
p.OfflineMode = true;
// Add a Script Task to the package.
TaskHost taskH = (TaskHost)p.Executables.Add("STOCK:ScriptTask");
// Run the package.
p.Execute();
// Review the results of the run.
if (taskH.ExecutionResult == DTSExecResult.Failure || taskH.ExecutionStatus == DTSExecStatus.Abend)
Console.WriteLine("Task failed or abended");
else
Console.WriteLine("Task ran successfully");
}
}
}
Imports System
Imports System.Collections.Generic
Imports System.Text
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.SqlServer.Dts.Tasks.ScriptTask
Namespace Package_API
Class Program
Shared Sub Main(ByVal args() As String)
Dim p As Package = New Package()
p.InteractiveMode = True
p.OfflineMode = True
' Add a Script Task to the package.
Dim taskH As TaskHost = CType(p.Executables.Add("STOCK:ScriptTask"), TaskHost)
' Run the package.
p.Execute()
' Review the results of the run.
If taskH.ExecutionResult = DTSExecResult.Failure Or taskH.ExecutionStatus = DTSExecStatus.Abend Then
Console.WriteLine("Task failed or abended")
Else
Console.WriteLine("Task ran successfully")
End If
End Sub
End Class
End Namespace
샘플 출력:
임무는 성공적으로 진행되었습니다
설명
런타임 엔진은 패키지나 컨테이너에 포함된 작업을 메서드 구현 Execute 체를 호출하여 처리합니다. 태스크는 이 메서드에서 핵심 논리와 기능을 구현하며, 메시지를 게시하고 열거에서 DTSExecResult 값을 반환하여 실행 결과를 제공합니다.