Export (0) Print
Expand All

ASExecuteDDLTask Class

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

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

[GuidAttribute("FC95DF06-8E20-4f90-BFD5-B48AFA59C158")]
[DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=10.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", 
	IconResource = "ExecuteTaskIcon")]
public class ASExecuteDDLTask : ASTaskBase, 
	IDTSComponentPersist

The ASExecuteDDLTask type exposes the following members.

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

  NameDescription
Public propertyConnectionNameInfrastructure. (Inherited from ASTaskBase.)
Public propertyExecutionValueReturns the result of the task execution. (Overrides Task.ExecutionValue.)
Protected propertyProgressEventNameInfrastructure. (Inherited from ASTaskBase.)
Public propertySourceGets or sets the text of 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. (Overrides ASTaskBase.StatusEventName.)
Protected propertySubComponentNameInfrastructure. (Overrides ASTaskBase.SubComponentName.)
Public propertyStatic memberTaskDescriptionReturns a description of the Analysis Services Execute DDL task.
Public propertyStatic memberTaskDisplayNameReturns the name of the 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. (Inherited from ASTaskBase.)
Protected methodFinalize (Inherited from Object.)
Protected methodFireError(String, String)Infrastructure. (Inherited from ASTaskBase.)
Protected methodFireError(Int32, String, String, String)Infrastructure. (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. (Overrides ASTaskBase.InternalExecute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object).)
Protected methodInternalValidateInfrastructure. (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. (Inherited from ASTaskBase.)
Protected methodSubscribeToProgressEventInfrastructure. (Inherited from ASTaskBase.)
Public methodToString (Inherited from Object.)
Protected methodUnsubscribeToProgressEventInfrastructure. (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. (Inherited from ASTaskBase.)
Protected methodValidateConnectionInfrastructure. (Inherited from ASTaskBase.)
Protected methodValidateDDLInfrastructure. (Overrides ASTaskBase.ValidateDDL(VariableDispenser, Connections, Exception).)
Protected methodWriteLogInfrastructure. (Inherited from ASTaskBase.)
Top

  NameDescription
Protected fieldbExecutionCanceledInfrastructure. (Inherited from ASTaskBase.)
Protected fieldbTraceErrorInfrastructure. (Inherited from ASTaskBase.)
Protected fieldddlInfrastructure. (Inherited from ASTaskBase.)
Protected fieldm_eventsInfrastructure. (Inherited from ASTaskBase.)
Protected fieldserverInfrastructure. (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