Export (0) Print
Expand All

ASExecuteDDLTask Class

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

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)

[GuidAttribute("7D47B41E-12A8-4957-9F7C-D39CBB0D2491")]
[DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=12.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", 
	IconResource = "ExecuteTaskIcon")]
public class ASExecuteDDLTask : ASTaskBase, 
	IDTSComponentPersist

The ASExecuteDDLTask type exposes the following members.

  NameDescription
Public methodASExecuteDDLTaskCreates a new instance of the ASExecuteDDLTask class.
Top

  NameDescription
Public propertyConnectionNameInfrastructure. Gets or sets the name of the connection for the analysis services task. (Inherited from ASTaskBase.)
Public propertyExecutionValueGets the result of the Analysis Services Execute DDL task. (Overrides Task.ExecutionValue.)
Protected propertyProgressEventNameInfrastructure. Gets the name of the progress event for the analysis services task. (Inherited from ASTaskBase.)
Public propertySourceGets or sets the name of the source that contains the DDL statement to be sent to the Analysis Services server.
Public propertySourceTypeGets or sets a value from the DDLSourceType enumeration indicating the source type that contains the DDL statements.
Protected propertyStatusEventNameInfrastructure. Gets the status event name for the Analysis Services Execute DDL task. (Overrides ASTaskBase.StatusEventName.)
Protected propertySubComponentNameInfrastructure. Gets the sub component name for the Analysis Services Execute DDL task. (Overrides ASTaskBase.SubComponentName.)
Public propertyStatic memberTaskDescriptionGets a description of the Analysis Services Execute DDL task.
Public propertyStatic memberTaskDisplayNameGets the unique name for the Analysis Services Execute DDL task.
Public propertyVersion*** Member deprecated; see Remarks. ***   Returns the version of the task. This property is read-only. (Inherited from Task.)
Top

  NameDescription
Public methodCanUpdate*** Member deprecated; see Remarks. ***   A Boolean that indicates whether the new package XML can update the old package XML. (Inherited from Task.)
Public methodEqualsDetermines whether two object instances are equal. (Inherited from DtsObject.)
Public methodExecuteInfrastructure. Executes the analysis services task. (Inherited from ASTaskBase.)
Protected methodFinalize (Inherited from Object.)
Protected methodFireError(String, String)Infrastructure. Raises an event when an error occurs. (Inherited from ASTaskBase.)
Protected methodFireError(Int32, String, String, String)Infrastructure. Raises an event when an error occurs. (Inherited from ASTaskBase.)
Public methodGetConnectionIDGets a String containing the ID of the connection. (Inherited from Task.)
Public methodGetConnectionNameGets a String containing the name of the connection. (Inherited from Task.)
Public methodGetHashCodeReturns the hash code for this instance. (Inherited from DtsObject.)
Public methodGetType (Inherited from Object.)
Public methodInitializeTaskInitializes the properties associated with the task. This method is called by the runtime and is not used in code. (Inherited from Task.)
Protected methodInternalExecuteInfrastructure. Executes the DDL task internally. (Overrides ASTaskBase.InternalExecute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object).)
Protected methodInternalValidateInfrastructure. Validates the DDL task internally. (Overrides ASTaskBase.InternalValidate(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging).)
Public methodLoadFromXMLThis method is not callable by your application code. To load a package saved as .xml, use the Application.LoadPackage method.
Protected methodMemberwiseClone (Inherited from Object.)
Public methodSaveToXMLThis method is not callable by your application code. To save a package as .xml, use the Application.SaveToXml method.
Protected methodStopExecutionInfrastructure. Stops the execution of the analysis service task. (Inherited from ASTaskBase.)
Protected methodSubscribeToProgressEventInfrastructure. Subscribes the task to progress event. (Inherited from ASTaskBase.)
Public methodToString (Inherited from Object.)
Protected methodUnsubscribeToProgressEventInfrastructure. Unsubscribes the task from the progress event. (Inherited from ASTaskBase.)
Public methodUpdate*** Member deprecated; see Remarks. ***   This method updates the old package XML with the new package XML if CanUpdate is set to true. (Inherited from Task.)
Public methodValidateInfrastructure. Validates the analysis service task. (Inherited from ASTaskBase.)
Protected methodValidateConnectionInfrastructure. Validates the task connection. (Inherited from ASTaskBase.)
Protected methodValidateDDLInfrastructure. Verifies that the DDL task is properly configured. (Overrides ASTaskBase.ValidateDDL(VariableDispenser, Connections, Exception).)
Protected methodWriteLogInfrastructure. Writes a log for the task. (Inherited from ASTaskBase.)
Top

  NameDescription
Protected fieldbExecutionCanceledInfrastructure. The execution is cancelled. (Inherited from ASTaskBase.)
Protected fieldbTraceErrorInfrastructure. The trace error. (Inherited from ASTaskBase.)
Protected fieldddlInfrastructure. The data definition language. (Inherited from ASTaskBase.)
Protected fieldm_eventsInfrastructure. The events. (Inherited from ASTaskBase.)
Protected fieldserverInfrastructure. The server. (Inherited from ASTaskBase.)
Top

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

  }

}

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

Community Additions

ADD
Show:
© 2014 Microsoft