共用方式為


DTSProcessingTask Class

Definition

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
[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")]
[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=14.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
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
[<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")>]
[<System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")>]
type DTSProcessingTask = class
    inherit ASTaskBase
    interface 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=14.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")>]
type DTSProcessingTask = class
    inherit ASTaskBase
    interface 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")>]
type DTSProcessingTask = class
    inherit ASTaskBase
    interface IDTSComponentPersist
Public NotInheritable Class DTSProcessingTask
Inherits ASTaskBase
Implements IDTSComponentPersist
Inheritance
DTSProcessingTask
Attributes
Implements

Examples

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()

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

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

Gets or sets the text of the processing command to be sent to the Analysis Services server.

ProgressEventName

Gets the name of the progress event for the analysis services task.

(Inherited from ASTaskBase)
StatusEventName

Gets the name of the status event for the analysis services task.

(Inherited from ASTaskBase)
SubComponentName

Gets the name of the sub component for the analysis services task.

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

Gets the description of the Analysis Services Processing task.

TaskDisplayName

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)

*** 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)

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)

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)

Loads the task information from XML. This method is not callable by your application code. To load a package saved as .xml, use the LoadPackage(String, IDTSEvents) method.

SaveToXML(XmlDocument, IDTSInfoEvents)

Saves component information to the package XML. This method is not callable by your application code. To save a package as .xml, use the SaveToXml(String, Package, IDTSEvents) method.

StopExecution()

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)

*** 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)

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