Freigeben über


ASExecuteDDLTask-Klasse

Executes Data Definition Language (DDL) commands against an instance of Microsoft SQL Server Analysis Services.

Vererbungshierarchie

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

Namespace:  Microsoft.DataTransformationServices.Tasks.DTSProcessingTask
Assembly:  Microsoft.SqlServer.ASTasks (in Microsoft.SqlServer.ASTasks.dll)

Syntax

'Declaration
<GuidAttribute("FCA58F9B-5937-4FCF-B851-8683F7B5A98F")> _
<DtsTaskAttribute(LocalizationType := GetType(ASExecuteDDLTask), UITypeName := "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91",  _
    IconResource := "ExecuteTaskIcon")> _
Public Class ASExecuteDDLTask _
    Inherits ASTaskBase _
    Implements IDTSComponentPersist
'Usage
Dim instance As ASExecuteDDLTask
[GuidAttribute("FCA58F9B-5937-4FCF-B851-8683F7B5A98F")]
[DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", 
    IconResource = "ExecuteTaskIcon")]
public class ASExecuteDDLTask : ASTaskBase, 
    IDTSComponentPersist
[GuidAttribute(L"FCA58F9B-5937-4FCF-B851-8683F7B5A98F")]
[DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = L"Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", 
    IconResource = L"ExecuteTaskIcon")]
public ref class ASExecuteDDLTask : public ASTaskBase, 
    IDTSComponentPersist
[<GuidAttribute("FCA58F9B-5937-4FCF-B851-8683F7B5A98F")>]
[<DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=11.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", 
    IconResource = "ExecuteTaskIcon")>]
type ASExecuteDDLTask =  
    class 
        inherit ASTaskBase 
        interface IDTSComponentPersist 
    end
public class ASExecuteDDLTask extends ASTaskBase implements IDTSComponentPersist

Der ASExecuteDDLTask-Typ macht folgende Elemente verfügbar.

Konstruktoren

  Name Beschreibung
Öffentliche Methode ASExecuteDDLTask Creates a new instance of the ASExecuteDDLTask class.

Zum Anfang

Eigenschaften

  Name Beschreibung
Öffentliche Eigenschaft ConnectionName Infrastruktur Gets or sets the name of the connection for the analysis services task. (Geerbt von ASTaskBase.)
Öffentliche Eigenschaft ExecutionValue Gets the result of the Analysis Services Execute DDL task. (Überschreibt Task.ExecutionValue.)
Geschützte Eigenschaft ProgressEventName Infrastruktur Gets the name of the progress event for the analysis services task. (Geerbt von ASTaskBase.)
Öffentliche Eigenschaft Source Gets or sets the name of the source that contains the DDL statement to be sent to the Analysis Services server.
Öffentliche Eigenschaft SourceType Gets or sets a value from the DDLSourceType enumeration indicating the source type that contains the DDL statements.
Geschützte Eigenschaft StatusEventName Infrastruktur Gets the status event name for the Analysis Services Execute DDL task. (Überschreibt ASTaskBase.StatusEventName.)
Geschützte Eigenschaft SubComponentName Infrastruktur Gets the sub component name for the Analysis Services Execute DDL task. (Überschreibt ASTaskBase.SubComponentName.)
Öffentliche EigenschaftStatisches Element TaskDescription Gets a description of the Analysis Services Execute DDL task.
Öffentliche EigenschaftStatisches Element TaskDisplayName Gets the unique name for the Analysis Services Execute DDL task.
Öffentliche Eigenschaft Version *** Member deprecated; see Remarks. ***    Returns the version of the task. This property is read-only. (Geerbt von Task.)

Zum Anfang

Methoden

  Name Beschreibung
Öffentliche Methode CanUpdate *** Member deprecated; see Remarks. ***    A Boolean that indicates whether the new package XML can update the old package XML. (Geerbt von Task.)
Öffentliche Methode Equals Determines whether two object instances are equal. (Geerbt von DtsObject.)
Öffentliche Methode Execute Infrastruktur Executes the analysis services task. (Geerbt von ASTaskBase.)
Geschützte Methode Finalize (Geerbt von Object.)
Geschützte Methode FireError(String, String) Infrastruktur Raises an event when an error occurs. (Geerbt von ASTaskBase.)
Geschützte Methode FireError(Int32, String, String, String) Infrastruktur Raises an event when an error occurs. (Geerbt von ASTaskBase.)
Öffentliche Methode GetConnectionID Gets a String containing the ID of the connection. (Geerbt von Task.)
Öffentliche Methode GetConnectionName Gets a String containing the name of the connection. (Geerbt von Task.)
Öffentliche Methode GetHashCode Returns the hash code for this instance. (Geerbt von DtsObject.)
Öffentliche Methode GetType (Geerbt von Object.)
Öffentliche Methode InitializeTask Initializes the properties associated with the task. This method is called by the runtime and is not used in code. (Geerbt von Task.)
Geschützte Methode InternalExecute Infrastruktur Executes the DDL task internally. (Überschreibt ASTaskBase.InternalExecute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object).)
Geschützte Methode InternalValidate Infrastruktur Validates the DDL task internally. (Überschreibt ASTaskBase.InternalValidate(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging).)
Öffentliche Methode LoadFromXML This method is not callable by your application code. To load a package saved as .xml, use the Application.LoadPackage method.
Geschützte Methode MemberwiseClone (Geerbt von Object.)
Öffentliche Methode SaveToXML This method is not callable by your application code. To save a package as .xml, use the Application.SaveToXml method.
Geschützte Methode StopExecution Infrastruktur Stops the execution of the analysis service task. (Geerbt von ASTaskBase.)
Geschützte Methode SubscribeToProgressEvent Infrastruktur Subscribes the task to progress event. (Geerbt von ASTaskBase.)
Öffentliche Methode ToString (Geerbt von Object.)
Geschützte Methode UnsubscribeToProgressEvent Infrastruktur Unsubscribes the task from the progress event. (Geerbt von ASTaskBase.)
Öffentliche Methode Update *** Member deprecated; see Remarks. ***    This method updates the old package XML with the new package XML if CanUpdate is set to true. (Geerbt von Task.)
Öffentliche Methode Validate Infrastruktur Validates the analysis service task. (Geerbt von ASTaskBase.)
Geschützte Methode ValidateConnection Infrastruktur Validates the task connection. (Geerbt von ASTaskBase.)
Geschützte Methode ValidateDDL Infrastruktur Verifies that the DDL task is properly configured. (Überschreibt ASTaskBase.ValidateDDL(VariableDispenser, Connections, Exception%).)
Geschützte Methode WriteLog Infrastruktur Writes a log for the task. (Geerbt von ASTaskBase.)

Zum Anfang

Felder

  Name Beschreibung
Geschütztes Feld bExecutionCanceled Infrastruktur The execution is cancelled. (Geerbt von ASTaskBase.)
Geschütztes Feld bTraceError Infrastruktur The trace error. (Geerbt von ASTaskBase.)
Geschütztes Feld ddl Infrastruktur The data definition language. (Geerbt von ASTaskBase.)
Geschütztes Feld m_events Infrastruktur The events. (Geerbt von ASTaskBase.)
Geschütztes Feld server Infrastruktur The server. (Geerbt von ASTaskBase.)

Zum Anfang

Beispiele

The following code sample creates, configures, and executes a new ASExecuteDDLTask that loads the DDL statement to execute from a file connection.

using Microsoft.SqlServer.Dts.Runtime;
using Microsoft.DataTransformationServices.Tasks.DTSProcessingTask;

class Module1
{

  public static void Main()
  {

    Package pkg = new Package();

    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;";

    ConnectionManager cmdCM;
    cmdCM = pkg.Connections.Add("FILE");
    cmdCM.Name = "Command Source Connection Manager";
    cmdCM.ConnectionString = "C:\\ddltest.txt";

    Executable exe = pkg.Executables.Add("Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask, " +
      "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("SourceType").SetValue(thTask, DDLSourceType.FileConnection);
      thTask.Properties("Source").SetValue(thTask, "Command Source Connection Manager");
    }

    DTSExecResult valResults = pkg.Validate(pkg.Connections, pkg.Variables, null, null);

    if (valResults==DTSExecResult.Success)
    {
      pkg.Execute();
    }

  }

}
Imports Microsoft.SqlServer.Dts.Runtime
Imports Microsoft.DataTransformationServices.Tasks.DTSProcessingTask

Module Module1

  Sub Main()

    Dim pkg As New Package

    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;"

    Dim cmdCM As ConnectionManager
    cmdCM = pkg.Connections.Add("FILE")
    cmdCM.Name = "Command Source Connection Manager"
    cmdCM.ConnectionString = "C:\ddltest.txt"

    Dim exe As Executable = pkg.Executables.Add( _
      "Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask, " & _
      "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("SourceType").SetValue(thTask, DDLSourceType.FileConnection)
      .Properties("Source").SetValue(thTask, "Command Source Connection Manager")
    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

Threadsicherheit

Alle öffentlichen static (Shared in Visual Basic)-Elemente dieses Typs sind Threadsicher. Für Instanzelemente wird die Threadsicherheit nicht gewährleistet.

Siehe auch

Verweis

Microsoft.DataTransformationServices.Tasks.DTSProcessingTask-Namespace