Condividi tramite


DTSProcessingTask Class

Processes objects in a SQL Server 2005 Analysis Services (SSAS) database.

Spazio dei nomi: Microsoft.DataTransformationServices.Tasks.DTSProcessingTask
Assembly : Microsoft.SqlServer.ASTasks (in microsoft.sqlserver.astasks.dll)

Sintassi

'Dichiarazione
<DtsTaskAttribute(LocalizationType:=GetType(DTSProcessingTask), TaskType:="DTS90", UITypeName:="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=9.00.242.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", IconResource:="ProcessTaskIcon")> _
<GuidAttribute("BA9F04BE-A93C-4c41-9E74-B8B9DB2D320B")> _
Public NotInheritable Class DTSProcessingTask
    Inherits ASTaskBase
    Implements IDTSComponentPersist
[DtsTaskAttribute(LocalizationType=typeof(DTSProcessingTask), TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=9.00.242.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", IconResource="ProcessTaskIcon")] 
[GuidAttribute("BA9F04BE-A93C-4c41-9E74-B8B9DB2D320B")] 
public sealed class DTSProcessingTask : ASTaskBase, IDTSComponentPersist
[DtsTaskAttribute(LocalizationType=typeof(DTSProcessingTask), TaskType=L"DTS90", UITypeName=L"Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=9.00.242.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", IconResource=L"ProcessTaskIcon")] 
[GuidAttribute(L"BA9F04BE-A93C-4c41-9E74-B8B9DB2D320B")] 
public ref class DTSProcessingTask sealed : public ASTaskBase, IDTSComponentPersist
/** @attribute DtsTaskAttribute(LocalizationType=Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask, TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=9.00.242.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", IconResource="ProcessTaskIcon") */ 
/** @attribute GuidAttribute("BA9F04BE-A93C-4c41-9E74-B8B9DB2D320B") */ 
public final class DTSProcessingTask extends ASTaskBase implements IDTSComponentPersist
DtsTaskAttribute(LocalizationType=Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask, TaskType="DTS90", UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.DTSProcessingTaskUI, Microsoft.SqlServer.ASTasksUI, Version=9.00.242.00, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", IconResource="ProcessTaskIcon") 
GuidAttribute("BA9F04BE-A93C-4c41-9E74-B8B9DB2D320B") 
public final class DTSProcessingTask extends ASTaskBase implements IDTSComponentPersist

Inheritance Hierarchy

System.Object
   Microsoft.SqlServer.Dts.Runtime.DtsObject
     Microsoft.SqlServer.Dts.Runtime.Task
       Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase
        Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.DTSProcessingTask

Esempio

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("MSOLAP90");
    asCM.Name = "Analysis Services Connection Manager";
    asCM.ConnectionString = "Data Source=<servername>;" +
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP.3;" +
      "Integrated Security=SSPI;Impersonation Level=Impersonate;";

    procCmd = "<Batch xmlns=\"https://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=9.0.242.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("MSOLAP90")
    asCM.Name = "Analysis Services Connection Manager"
    asCM.ConnectionString = "Data Source=<servername>;" & _
      "Initial Catalog=Adventure Works DW;Provider=MSOLAP.3;" & _
      "Integrated Security=SSPI;Impersonation Level=Impersonate;"

    procCmd = "<Batch https://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=9.0.242.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

Thread Safety

Any public static (Shared in Microsoft Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

Piattaforme

Piattaforme di sviluppo

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Piattaforme di destinazione

Per un elenco delle piattaforme supportate, vedere Requisiti hardware e software per l'Installazione di SQL Server 2005.

Vedere anche

Riferimento

DTSProcessingTask Members
Microsoft.DataTransformationServices.Tasks.DTSProcessingTask Namespace