Integration Services 任务Integration Services Tasks

适用于: SQL Server 是 Azure 数据工厂中的 SSIS Integration Runtime Azure Synapse Analytics (SQL DW)APPLIES TO: yesSQL Server yesSSIS Integration Runtime in Azure Data Factory yesAzure Synapse Analytics (SQL DW)

任务是一些控制流元素,它定义包控制流中执行的工作单元。Tasks are control flow elements that define units of work that are performed in a package control flow. SQL ServerSQL ServerIntegration ServicesIntegration Services 包由一个或多个任务组成。An SQL ServerSQL Server Integration ServicesIntegration Services package is made up of one or more tasks. 如果包中包含多个任务,则它们将按照优先约束在控制流中进行连接和排序。If the package contains more than one task, they are connected and sequenced in the control flow by precedence constraints.

您还可使用支持 COM 的编程语言(如 Visual Basic)或 .NET 编程语言(如 C#)编写自定义任务。You can also write custom tasks using a programming language that supports COM, such as Visual Basic, or a .NET programming language, such as C#.

SSISSSIS 设计器是 SQL ServerSQL ServerIntegration ServicesIntegration Services 中用于处理包的图形工具,可提供用于创建包控制流的设计界面,以及用于配置任务的自定义编辑器。The SSISSSIS Designer, the graphical tool in SQL ServerSQL Server Integration ServicesIntegration Services for working with packages, provides the design surface for creating package control flow, and provides custom editors for configuring tasks. 你还可以对 SQL ServerSQL ServerIntegration ServicesIntegration Services 对象模型进行编程,以便通过编程方式创建包。You can also program the SQL ServerSQL Server Integration ServicesIntegration Services object model to create packages programmatically.

任务的类型Types of Tasks

Integration ServicesIntegration Services 中包括下列类型的任务。includes the following types of tasks.

数据流任务Data Flow Task
数据流任务用于运行数据流以提取数据、应用列级转换和加载数据。The task that runs data flows to extract data, apply column level transformations, and load data.

数据准备任务Data Preparation Tasks
这些任务执行以下过程:复制文件和目录;下载文件和数据;运行 Web 方法;对 XML 文档应用操作以及对数据进行事件探查以便清除。These tasks do the following processes: copy files and directories; download files and data; run Web methods; apply operations to XML documents; and profile data for cleansing.

工作流任务Workflow Tasks
工作流任务与其他进程通信以运行包、程序或批处理文件,在包之间发送和接收消息,发送电子邮件,读取 Windows Management Instrumentation (WMI) 数据和监视 WMI 事件。The tasks that communicate with other processes to run packages, run programs or batch files, send and receive messages between packages, send e-mail messages, read Windows Management Instrumentation (WMI) data, and watch for WMI events.

SQL Server 任务SQL Server Tasks
SQL Server 任务用于访问、复制、插入、删除和修改 SQL ServerSQL Server 对象和数据。The tasks that access, copy, insert, delete, and modify SQL ServerSQL Server objects and data.

脚本任务Scripting Tasks
脚本任务通过使用脚本来扩展包功能。The tasks that extend package functionality by using scripts.

Analysis Services 任务Analysis Services Tasks
该任务用于创建、修改、删除和处理 Analysis ServicesAnalysis Services 对象。The tasks that create, modify, delete, and process Analysis ServicesAnalysis Services objects.

维护任务Maintenance Tasks
维护任务用于执行管理功能,如备份和收缩 SQL ServerSQL Server 数据库、重新生成和重新组织索引以及运行 SQL ServerSQL Server 代理作业。The tasks that perform administrative functions such as backing up and shrinking SQL ServerSQL Server databases, rebuilding and reorganizing indexes, and running SQL ServerSQL Server Agent jobs.

自定义任务Custom Tasks
此外,您还可以使用支持 COM 的编程语言(如 Visual Basic)或 .NET 编程语言(如 C#)编写自定义任务。Additionally, you can write custom tasks using a programming language that supports COM, such as Visual Basic, or a .NET programming language, such as C#. 如果希望在 SSISSSIS 设计器中访问自定义任务,那么你可以为该任务创建和注册一个用户接口。If you want to access your custom task in the SSISSSIS Designer, you can create and register a user interface for the task. 有关详细信息,请参阅 开发自定义任务For more information, see Developing a Custom Task.

任务的配置Configuration of Tasks

Integration ServicesIntegration Services 包可以只包含单个任务,如在包运行时删除数据库表中记录的执行 SQL 任务。An Integration ServicesIntegration Services package can contain a single task, such as an Execute SQL task that deletes records in a database table when the package runs. 但是,包通常包含多个任务,而且每个任务都被设置为在包控制流上下文中运行。However, packages typically contain several tasks, and each task is set to run within the context of the package control flow. 事件处理程序是为响应运行时事件而运行的工作流,该程序中也可包含任务。Event handlers, which are workflows that run in response to run-time events, can also have tasks.

有关使用 SSISSSIS 设计器向包添加任务的详细信息,请参阅 在控制流中添加或删除任务或容器For more information about adding a task to a package using SSISSSIS Designer, see Add or Delete a Task or a Container in a Control Flow.

有关如何以编程方式向包中添加任务的详细信息,请参阅 以编程方式添加任务For more information about adding a task to a package programmatically, see Adding Tasks Programmatically.

对于每个任务,可以使用 SSISSSIS 设计器为每个任务提供的自定义对话框单独配置,也可以使用 SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT)中包含的“属性”窗口进行配置。Each task can be configured individually using the custom dialog boxes for each task that SSISSSIS Designer provides, or the Properties window included in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT). 一个包中可以包含多个相同类型的任务(如六个执行 SQL 任务),对每个任务可进行不同的配置。A package can include multiple tasks of the same type-for example, six Execute SQL tasks-and each task can be configured differently. 有关详细信息,请参阅 设置任务或容器的属性For more information, see Set the Properties of a Task or Container.

任务连接和组Tasks Connections and Groups

如果连接和分组任务中包含多个任务,则它们将被按照优先约束在控制流中进行连接和排序。If the task contains more than one task, they are connected and sequenced in the control flow by precedence constraints. 有关详细信息,请参阅 优先约束For more information, see Precedence Constraints.

任务可被分组到一起作为一个工作单元执行,也可在循环中重复执行。Tasks can be grouped together and performed as a single unit of work, or repeated in a loop. 有关详细信息,请参阅 Foreach Loop ContainerFor Loop ContainerSequence ContainerFor more information, see Foreach Loop Container, For Loop Container, and Sequence Container.

在控制流中添加或删除任务或容器Add or Delete a Task or a Container in a Control Flow