Classe ASExecuteDDLTask

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

Gerarchia di ereditarietà

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

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

Sintassi

'Dichiarazione
<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
'Utilizzo
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

Nel tipo ASExecuteDDLTask sono esposti i membri seguenti.

Costruttori

  Nome Descrizione
Metodo pubblico ASExecuteDDLTask Creates a new instance of the ASExecuteDDLTask class.

In alto

Proprietà

  Nome Descrizione
Proprietà pubblica ConnectionName Infrastruttura. Gets or sets the name of the connection for the analysis services task. Ereditato da ASTaskBase.
Proprietà pubblica ExecutionValue Gets the result of the Analysis Services Execute DDL task. Esegue l'override di Task.ExecutionValue.
Proprietà protetta ProgressEventName Infrastruttura. Gets the name of the progress event for the analysis services task. Ereditato da ASTaskBase.
Proprietà pubblica Source Gets or sets the name of the source that contains the DDL statement to be sent to the Analysis Services server.
Proprietà pubblica SourceType Gets or sets a value from the DDLSourceType enumeration indicating the source type that contains the DDL statements.
Proprietà protetta StatusEventName Infrastruttura. Gets the status event name for the Analysis Services Execute DDL task. Esegue l'override di ASTaskBase.StatusEventName.
Proprietà protetta SubComponentName Infrastruttura. Gets the sub component name for the Analysis Services Execute DDL task. Esegue l'override di ASTaskBase.SubComponentName.
Proprietà pubblicaMembro statico TaskDescription Gets a description of the Analysis Services Execute DDL task.
Proprietà pubblicaMembro statico TaskDisplayName Gets the unique name for the Analysis Services Execute DDL task.
Proprietà pubblica Version *** Member deprecated; see Remarks. ***    Returns the version of the task. This property is read-only. Ereditato da Task.

In alto

Metodi

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

In alto

Campi

  Nome Descrizione
Campo protetto bExecutionCanceled Infrastruttura. The execution is cancelled. Ereditato da ASTaskBase.
Campo protetto bTraceError Infrastruttura. The trace error. Ereditato da ASTaskBase.
Campo protetto ddl Infrastruttura. The data definition language. Ereditato da ASTaskBase.
Campo protetto m_events Infrastruttura. The events. Ereditato da ASTaskBase.
Campo protetto server Infrastruttura. The server. Ereditato da ASTaskBase.

In alto

Esempi

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

Protezione dei thread

I membri static (Shared in Visual Basic) pubblici di questo tipo sono affidabili. Non è invece garantita la sicurezza dei membri dell'istanza.

Vedere anche

Riferimento

Spazio dei nomi Microsoft.DataTransformationServices.Tasks.DTSProcessingTask