ASExecuteDDLTask 类
Executes Data Definition Language (DDL) commands against an instance of Microsoft SQL Server Analysis Services.
继承层次结构
System. . :: . .Object
Microsoft.SqlServer.Dts.Runtime. . :: . .DtsObject
Microsoft.SqlServer.Dts.Runtime. . :: . .Task
Microsoft.DataTransformationServices.Tasks.DTSProcessingTask. . :: . .ASTaskBase
Microsoft.DataTransformationServices.Tasks.DTSProcessingTask..::..ASExecuteDDLTask
命名空间: Microsoft.DataTransformationServices.Tasks.DTSProcessingTask
程序集: Microsoft.SqlServer.ASTasks(在 Microsoft.SqlServer.ASTasks.dll 中)
语法
声明
<GuidAttribute("FC95DF06-8E20-4f90-BFD5-B48AFA59C158")> _
<DtsTaskAttribute(LocalizationType := GetType(ASExecuteDDLTask), UITypeName := "Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=10.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91", _
IconResource := "ExecuteTaskIcon")> _
Public Class ASExecuteDDLTask _
Inherits ASTaskBase _
Implements IDTSComponentPersist
用法
Dim instance As ASExecuteDDLTask
[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
[GuidAttribute(L"FC95DF06-8E20-4f90-BFD5-B48AFA59C158")]
[DtsTaskAttribute(LocalizationType = typeof(ASExecuteDDLTask), UITypeName = L"Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=10.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91",
IconResource = L"ExecuteTaskIcon")]
public ref class ASExecuteDDLTask : public ASTaskBase,
IDTSComponentPersist
[<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")>]
type ASExecuteDDLTask =
class
inherit ASTaskBase
interface IDTSComponentPersist
end
public class ASExecuteDDLTask extends ASTaskBase implements IDTSComponentPersist
ASExecuteDDLTask 类型公开以下成员。
属性
名称 | 说明 | |
---|---|---|
ConnectionName | 基础结构。 (从 ASTaskBase 继承。) | |
ExecutionValue | Returns the result of the task execution. (覆盖 Task. . :: . .ExecutionValue。) | |
ProgressEventName | 基础结构。 (从 ASTaskBase 继承。) | |
Source | Gets or sets the text of the DDL statement to be sent to the Analysis Services server. | |
SourceType | Gets or sets a value from the DDLSourceType enumeration indicating the source type that contains the DDL statements. | |
StatusEventName | 基础结构。 (覆盖 ASTaskBase. . :: . .StatusEventName。) | |
SubComponentName | 基础结构。 (覆盖 ASTaskBase. . :: . .SubComponentName。) | |
TaskDescription | Returns a description of the Analysis Services Execute DDL task. | |
TaskDisplayName | Returns the name of the Execute DDL task. | |
Version | *** Member deprecated; see Remarks. *** Returns the version of the task. This property is read-only. (从 Task 继承。) |
页首
方法
名称 | 说明 | |
---|---|---|
CanUpdate | *** Member deprecated; see Remarks. *** A Boolean that indicates whether the new package XML can update the old package XML. (从 Task 继承。) | |
Equals | Determines whether two object instances are equal. (从 DtsObject 继承。) | |
Execute | 基础结构。 (从 ASTaskBase 继承。) | |
Finalize | (从 Object 继承。) | |
FireError(String, String) | 基础结构。 (从 ASTaskBase 继承。) | |
FireError(Int32, String, String, String) | 基础结构。 (从 ASTaskBase 继承。) | |
GetConnectionID | Gets a String containing the ID of the connection. (从 Task 继承。) | |
GetConnectionName | Gets a String containing the name of the connection. (从 Task 继承。) | |
GetHashCode | Returns the hash code for this instance. (从 DtsObject 继承。) | |
GetType | (从 Object 继承。) | |
InitializeTask | Initializes the properties associated with the task. This method is called by the runtime and is not used in code. (从 Task 继承。) | |
InternalExecute | 基础结构。 (覆盖 ASTaskBase. . :: . .InternalExecute(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging, Object)。) | |
InternalValidate | 基础结构。 (覆盖 ASTaskBase. . :: . .InternalValidate(Connections, VariableDispenser, IDTSComponentEvents, IDTSLogging)。) | |
LoadFromXML | This method is not callable by your application code. To load a package saved as .xml, use the Application..::..LoadPackage method. | |
MemberwiseClone | (从 Object 继承。) | |
SaveToXML | This method is not callable by your application code. To save a package as .xml, use the Application..::..SaveToXml method. | |
StopExecution | 基础结构。 (从 ASTaskBase 继承。) | |
SubscribeToProgressEvent | 基础结构。 (从 ASTaskBase 继承。) | |
ToString | (从 Object 继承。) | |
UnsubscribeToProgressEvent | 基础结构。 (从 ASTaskBase 继承。) | |
Update | *** Member deprecated; see Remarks. *** This method updates the old package XML with the new package XML if CanUpdate is set to true. (从 Task 继承。) | |
Validate | 基础结构。 (从 ASTaskBase 继承。) | |
ValidateConnection | 基础结构。 (从 ASTaskBase 继承。) | |
ValidateDDL | 基础结构。 (覆盖 ASTaskBase. . :: . .ValidateDDL(VariableDispenser, Connections, Exception%)。) | |
WriteLog | 基础结构。 (从 ASTaskBase 继承。) |
页首
字段
名称 | 说明 | |
---|---|---|
bExecutionCanceled | 基础结构。 (从 ASTaskBase 继承。) | |
bTraceError | 基础结构。 (从 ASTaskBase 继承。) | |
ddl | 基础结构。 (从 ASTaskBase 继承。) | |
m_events | 基础结构。 (从 ASTaskBase 继承。) | |
server | 基础结构。 (从 ASTaskBase 继承。) |
页首
示例
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
线程安全
此类型的任何公共 static(在 Visual Basic 中为 Shared) 成员都是线程安全的。不保证所有实例成员都是线程安全的。