DTSProcessingTask Class

Definition

处理 Microsoft SQL Server Analysis Services 数据库中的对象。Processes objects in a Microsoft SQL Server Analysis Services database.

public ref class DTSProcessingTask sealed : Microsoft::DataTransformationServices::Tasks::DTSProcessingTask::ASTaskBase, Microsoft::SqlServer::Dts::Runtime::IDTSComponentPersist
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ProcessTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask), TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=13.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
public sealed class DTSProcessingTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ProcessTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask), TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=14.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
public sealed class DTSProcessingTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ProcessTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask), TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=15.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
public sealed class DTSProcessingTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
type DTSProcessingTask = class
    inherit ASTaskBase
    interface IDTSComponentPersist
Public NotInheritable Class DTSProcessingTask
Inherits ASTaskBase
Implements IDTSComponentPersist
Inheritance
DTSProcessingTask
Attributes
Implements

Examples

下面的代码示例创建、配置和执行新的,以 DTSProcessingTask 处理艾德公司 DW 示例数据库中的目标邮件挖掘模型。The following code sample creates, configures, and executes a new DTSProcessingTask that processes the Targeted Mailing mining model in the Adventure Works DW sample database.

using Microsoft.SqlServer.Dts.Runtime;  
using System.Reflection;  
  
class Module1  
{  
  
  public static void Main()  
  {  
  
    Package pkg = new Package();  
    string procCmd;  
  
    ConnectionManager asCM;  
    asCM = pkg.Connections.Add("MSOLAP100");  
    asCM.Name = "Analysis Services Connection Manager";  
    asCM.ConnectionString = "Data Source=<servername>;" +  
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP;" +  
      "Integrated Security=SSPI;Impersonation Level=Impersonate;";  
  
    procCmd = "<Batch xmlns=\"http://schemas.microsoft.com/analysisservices/2003/engine\">" +  
      "<Parallel>" +  
        "<Process xmlns:xsd=\"http://www.w3.org/2001/XMLSchema\" " +  
            "xmlns:xsi=\"http://www.w3.org/2001/XMLSchema-instance\">" +  
          "<Object>" +  
            "<DatabaseID>Adventure Works DW</DatabaseID>" +  
            "<MiningStructureID>Targeted Mailing</MiningStructureID>" +  
          "</Object>" +  
          "<Type>ProcessFull</Type>" +  
          "<WriteBackTableCreation>UseExisting</WriteBackTableCreation>" +  
        "</Process>" +  
      "</Parallel>" +  
    "</Batch>";  
  
    Executable exe = pkg.Executables.Add("Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask, " +  
      "Microsoft.SqlServer.ASTasks, Version=10.0.0.0, " +  
      "Culture=neutral, PublicKeyToken=89845dcd8080cc91");  
    TaskHost thTask = (TaskHost) exe;  
    {  
      thTask.Properties("ConnectionName").SetValue(thTask, "Analysis Services Connection Manager");  
      thTask.Properties("ProcessingCommands").SetValue(thTask, procCmd);  
    }  
  
    DTSExecResult valResults = pkg.Validate(pkg.Connections, pkg.Variables, null, null);  
  
    if (valResults==DTSExecResult.Success)  
    {  
      pkg.Execute();  
    }  
  
  }  
  
}  
Imports Microsoft.SqlServer.Dts.Runtime  
Imports System.Reflection  
  
Module Module1  
  
  Sub Main()  
  
    Dim pkg As New Package  
    Dim procCmd As String  
  
    Dim asCM As ConnectionManager  
    asCM = pkg.Connections.Add("MSOLAP100")  
    asCM.Name = "Analysis Services Connection Manager"  
    asCM.ConnectionString = "Data Source=<servername>;" & _  
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP;" & _  
      "Integrated Security=SSPI;Impersonation Level=Impersonate;"  
  
    procCmd = "<Batch xmlns=""http://schemas.microsoft.com/analysisservices/2003/engine"">" & _  
      "<Parallel>" & _  
        "<Process xmlns:xsd=""http://www.w3.org/2001/XMLSchema"" " & _  
            "xmlns:xsi=""http://www.w3.org/2001/XMLSchema-instance"">" & _  
          "<Object>" & _  
            "<DatabaseID>Adventure Works DW</DatabaseID>" & _  
            "<MiningStructureID>Targeted Mailing</MiningStructureID>" & _  
          "</Object>" & _  
          "<Type>ProcessFull</Type>" & _  
          "<WriteBackTableCreation>UseExisting</WriteBackTableCreation>" & _  
        "</Process>" & _  
      "</Parallel>" & _  
    "</Batch>"  
  
    Dim exe As Executable = pkg.Executables.Add( _  
      "Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask, " & _  
      "Microsoft.SqlServer.ASTasks, Version=10.0.0.0, " & _  
      "Culture=neutral, PublicKeyToken=89845dcd8080cc91")  
    Dim thTask As TaskHost = CType(exe, TaskHost)  
    With thTask  
      .Properties("ConnectionName").SetValue(thTask, _  
        "Analysis Services Connection Manager")  
      .Properties("ProcessingCommands").SetValue(thTask, procCmd)  
    End With  
  
    Dim valResults As DTSExecResult = pkg.Validate( _  
      pkg.Connections, pkg.Variables, Nothing, Nothing)  
  
    If valResults = DTSExecResult.Success Then  
      pkg.Execute()  
    End If  
  
  End Sub  
  
End Module  

Constructors

DTSProcessingTask()

初始化 DTSProcessingTask 类的新实例。Initializes a new instance of the DTSProcessingTask class.

Fields

bExecutionCanceled

已取消执行。The execution is cancelled.

(Inherited from ASTaskBase)
bTraceError

跟踪错误。The trace error.

(Inherited from ASTaskBase)
ddl

数据定义语言。The data definition language.

(Inherited from ASTaskBase)
m_events

事件。The events.

(Inherited from ASTaskBase)
server

服务器。The server.

(Inherited from ASTaskBase)

Properties

ConnectionName

获取或设置 Analysis Services 任务的连接名称。Gets or sets the name of the connection for the analysis services task.

(Inherited from ASTaskBase)
ExecutionValue

返回用户定义对象。Returns a user-defined object. 此字段为只读。This field is read-only.

(Inherited from Task)
ProcessingCommands

获取或设置要发送到 Analysis Services 服务器的处理命令的文本。Gets or sets the text of the processing command to be sent to the Analysis Services server.

ProgressEventName

获取 Analysis Services 任务的进度事件名称。Gets the name of the progress event for the analysis services task.

(Inherited from ASTaskBase)
StatusEventName

获取 Analysis Services 任务的状态事件名称。Gets the name of the status event for the analysis services task.

(Inherited from ASTaskBase)
SubComponentName

获取 Analysis Services 任务的子组件名称。Gets the name of the sub component for the analysis services task.

(Inherited from ASTaskBase)
TargetServerVersion (Inherited from Task)
TaskDescription

获取 Analysis Services 处理任务的说明。Gets the description of the Analysis Services Processing task.

TaskDisplayName

获取 Analysis Services 处理任务的唯一名称。Gets the unique name for the Analysis Services Processing task.

Version

***   成员已弃用; 请参阅 "备注"。 ***    返回任务的版本。*** Member deprecated; see Remarks. ***   Returns the version of the task. 此属性为只读。This property is read-only.

(Inherited from Task)

Methods

CanUpdate(String)

***   成员已弃用; 请参阅 "备注"。 ***    一个布尔值,该值指示新包 XML 是否可以更新旧包 XML。*** Member deprecated; see Remarks. ***   A Boolean that indicates whether the new package XML can update the old package XML.

(Inherited from Task)
Equals(Object)

确定两个对象实例是否相等。Determines whether two object instances are equal.

(Inherited from DtsObject)
Execute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object)

执行 Analysis Services 任务。Executes the analysis services task.

(Inherited from ASTaskBase)
ExecuteCommand(String, Connections, IDTSComponentEvents, Object) (Inherited from ASTaskBase)
FireError(Int32, String, String, String)

出现错误时引发事件。Raises an event when an error occurs.

(Inherited from ASTaskBase)
FireError(String, String)

出现错误时引发事件。Raises an event when an error occurs.

(Inherited from ASTaskBase)
GetConnectionID(Connections, String)

获取包含连接的 ID 的字符串。Gets a String containing the ID of the connection.

(Inherited from Task)
GetConnectionName(Connections, String)

获取包含连接名称的字符串。Gets a String containing the name of the connection.

(Inherited from Task)
GetHashCode()

返回此实例的哈希代码。Returns the hash code for this instance.

(Inherited from DtsObject)
InitializeTask(Connections, VariableDispenser, IDTSInfoEvents, IDTSLogging, EventInfos, LogEntryInfos, ObjectReferenceTracker)

初始化与该任务相关联的属性。Initializes the properties associated with the task. 此方法由运行时调用,在代码中未使用。This method is called by the runtime and is not used in code.

(Inherited from Task)
InternalExecute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object)

在内部执行任务。Executes the task internally.

(Inherited from ASTaskBase)
InternalValidate(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging)

在内部验证任务。Validates the task internally.

(Inherited from ASTaskBase)
LoadFromXML(XmlElement, IDTSInfoEvents)

从 XML 加载任务信息。Loads the task information from XML. 此方法不能由应用程序代码调用。This method is not callable by your application code. 若要加载保存为 .xml 的包,请使用 LoadPackage(String, IDTSEvents) 方法。To load a package saved as .xml, use the LoadPackage(String, IDTSEvents) method.

SaveToXML(XmlDocument, IDTSInfoEvents)

将组件信息保存到包 XML。Saves component information to the package XML. 此方法不能由应用程序代码调用。This method is not callable by your application code. 若将包保存为 .xml,请使用 SaveToXml(String, Package, IDTSEvents) 方法。To save a package as .xml, use the SaveToXml(String, Package, IDTSEvents) method.

StopExecution()

停止执行 Analysis Services 任务。Stops the execution of the analysis service task.

(Inherited from ASTaskBase)
SubscribeToProgressEvent(SessionTrace)

订阅任务到进度事件。Subscribes the task to progress event.

(Inherited from ASTaskBase)
UnsubscribeToProgressEvent(SessionTrace)

从进度事件取消订阅任务。Unsubscribes the task from the progress event.

(Inherited from ASTaskBase)
Update(String)

***   成员已弃用; 请参阅 "备注"。 ***    如果设置为 true,则此方法用新包 XML 更新旧的包 XML CanUpdate(String)*** Member deprecated; see Remarks. ***   This method updates the old package XML with the new package XML if CanUpdate(String) is set to true.

(Inherited from Task)
Validate(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging)

验证 Analysis Services 任务。Validates the analysis service task.

(Inherited from ASTaskBase)
ValidateConnection(Connections)

验证任务连接。Validates the task connection.

(Inherited from ASTaskBase)
ValidateDDL(VariableDispenser, Connections, Exception)

验证数据定义语言。Validates the data definition language.

(Inherited from ASTaskBase)
WriteLog(IDTSLogging, String)

编写任务日志。Writes a log for the task.

(Inherited from ASTaskBase)

Applies to