ASExecuteDDLTask 类
定义
重要
一些信息与预发行产品相关,相应产品在发行之前可能会进行重大修改。 对于此处提供的信息,Microsoft 不作任何明示或暗示的担保。
对 Microsoft SQL Server Analysis Services 实例执行数据定义语言 (DDL) 命令。
public ref class ASExecuteDDLTask : Microsoft::DataTransformationServices::Tasks::DTSProcessingTask::ASTaskBase, Microsoft::SqlServer::Dts::Runtime::IDTSComponentPersist
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=13.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
public class ASExecuteDDLTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=14.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
public class ASExecuteDDLTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
[System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")]
[Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=15.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")]
public class ASExecuteDDLTask : Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASTaskBase, Microsoft.SqlServer.Dts.Runtime.IDTSComponentPersist
[<Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=13.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")>]
[<System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")>]
type ASExecuteDDLTask = class
inherit ASTaskBase
interface IDTSComponentPersist
[<System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")>]
[<Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=14.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")>]
type ASExecuteDDLTask = class
inherit ASTaskBase
interface IDTSComponentPersist
[<System.Runtime.InteropServices.Guid("B8A6644B-E7A4-4409-8B78-59572781BD15")>]
[<Microsoft.SqlServer.Dts.Runtime.DtsTask(IconResource="ExecuteTaskIcon", LocalizationType=typeof(Microsoft.DataTransformationServices.Tasks.DTSProcessingTask.ASExecuteDDLTask), UITypeName="Microsoft.DataTransformationServices.Tasks.DTSProcessingTaskUI.ASExecuteDDLTaskUI, Microsoft.SqlServer.ASTasksUI, Version=15.0.0.0, Culture=Neutral, PublicKeyToken=89845dcd8080cc91")>]
type ASExecuteDDLTask = class
inherit ASTaskBase
interface IDTSComponentPersist
Public Class ASExecuteDDLTask
Inherits ASTaskBase
Implements IDTSComponentPersist
- 继承
- 属性
- 实现
示例
下面的代码示例创建、配置和执行一个新的 ASExecuteDDLTask ,用于加载要从文件连接执行的 DDL 语句。
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
构造函数
ASExecuteDDLTask() |
创建 ASExecuteDDLTask 类的新实例。 |
字段
bExecutionCanceled |
已取消执行。 (继承自 ASTaskBase) |
bTraceError |
跟踪错误。 (继承自 ASTaskBase) |
ddl |
数据定义语言。 (继承自 ASTaskBase) |
m_events |
事件。 (继承自 ASTaskBase) |
server |
服务器。 (继承自 ASTaskBase) |
属性
ConnectionName |
获取或设置 Analysis Services 任务的连接名称。 (继承自 ASTaskBase) |
ExecutionValue |
获取 Analysis Services 执行 DDL 任务的结果。 |
ProgressEventName |
获取 Analysis Services 任务的进度事件名称。 (继承自 ASTaskBase) |
Source |
获取或设置包含要发送到 Analysis Services 服务器的 DDL 语句的源的名称。 |
SourceType |
获取或设置 DDLSourceType 枚举中的一个值,该值指示包含 DDL 语句的源类型。 |
StatusEventName |
获取 Analysis Services 执行 DDL 任务的状态事件名称。 |
SubComponentName |
获取 Analysis Services 执行 DDL 任务的子组件名称。 |
TargetServerVersion |
对 Microsoft SQL Server Analysis Services 实例执行数据定义语言 (DDL) 命令。 (继承自 Task) |
TaskDescription |
获取 Analysis Services 执行 DDL 任务的说明。 |
TaskDisplayName |
获取 Analysis Services 执行 DDL 任务的唯一名称。 |
Version |
*** 不推荐使用的成员;请参阅“备注”。 *** 返回任务的版本。 此属性为只读。 (继承自 Task) |