catalog.create_execution(SSISDB 数据库)catalog.create_execution (SSISDB Database)

适用范围:SQL Server,包括 Linux Azure SQL 数据库yesAzure SQL 数据仓库no并行数据仓库 APPLIES TO: yesSQL Server, including on Linux yesAzure SQL Database yesAzure SQL Data Warehouse noParallel Data Warehouse

适用对象: yesSQL ServeryesAzure SQL 数据库noAzure SQL 数据仓库no并行数据仓库APPLIES TO: yesSQL Server noAzure SQL Database noAzure SQL Data Warehouse noParallel Data Warehouse

Integration ServicesIntegration Services 目录中创建执行实例。Creates an instance of execution in the Integration ServicesIntegration Services catalog.

此存储过程使用默认服务器日志记录级别。This stored procedure uses the default server logging level.

语法Syntax

catalog.create_execution [@folder_name = folder_name  
     , [@project_name =] project_name  
     , [@package_name =] package_name  
  [  , [@reference_id =] reference_id ]  
  [  , [@use32bitruntime =] use32bitruntime ] 
  [  , [@runinscaleout =] runinscaleout ]
  [  , [@useanyworker =] useanyworker ] 
     , [@execution_id =] execution_id OUTPUT  

参数Arguments

[@folder_name =] folder_name[@folder_name =] folder_name
包含要执行的包的文件夹名称。The name of the folder that contains the package that is to be executed. folder_namenvarchar(128)The folder_name is nvarchar(128).

[@project_name =] project_name[@project_name =] project_name
包含要执行的包的项目的名称。The name of the project that contains the package that is to be executed. project_namenvarchar(128)The project_name is nvarchar(128).

[@package_name =] package_name[@package_name =] package_name
包含要执行的包的名称。The name of the package that is to be executed. package_name 为 nvarchar(260)。The package_name is nvarchar(260).

[@reference_id =] reference_id[@reference_id =] reference_id
环境引用的唯一标识符。A unique identifier for an environment reference. 此参数可选。This parameter is optional. reference_id 为 bigint。The reference_id is bigint.

[@use32bitruntime =] use32bitruntime[@use32bitruntime =] use32bitruntime
指示是否应使用 32 位运行时在 64 位操作系统上运行包。Indicates if the 32-bit runtime should be used to run the package on a 64-bit operating system. 使用值 1 表示在 64 位操作系统上运行时,使用 32 位运行时执行此包。Use the value of 1 to execute the package with the 32-bit runtime when running on a 64-bit operating system. 使用值 0 表示在 64 位操作系统上运行时,使用 64 位运行时执行此包。Use the value of 0 to execute the package with the 64-bit runtime when running on a 64-bit operating system. 此参数可选。This parameter is optional. Use32bitruntime 为 bit。The Use32bitruntime is bit.

[@runinscaleout =] runinscaleout[@runinscaleout =] runinscaleout
指示执行是否在 Scale Out 中进行。使用值 1 在 Scale Out 中执行包。使用值 0 执行包,而无需 Scale Out。此参数可选。Indicate whether the execution is in Scale Out. Use the value of 1 to execute the package in Scale Out. Use the value of 0 to execute the package without Scale Out. This parameter is optional. 如果未指定,其值在 [SSISDB].[catalog].[catalog_properties] 中设置为 DEFAULT_EXECUTION_MODE。If not specified, its value is set to DEFAULT_EXECUTION_MODE in [SSISDB].[catalog].[catalog_properties]. runinscaleout 为 bit。The runinscaleout is bit.

[@useanyworker =] useanyworker[@useanyworker =] useanyworker
指示是否允许任何 Scale Out Worker 执行相应操作。Indicate whether any Scale Out Worker is allowed to do the execution.

  • 借助任何 Scale Out Worker 使用值 1 执行包。Use the value of 1 to execute the package with any Scale Out Worker. @useanyworker 设为 true 时,尚未达到最大任务数(如辅助角色配置文件中所示)的任何辅助角色都可用于运行包。When you set @useanyworker to true, any worker whose maximum task count (as specified in the worker configuration file) is not yet reached is available to run the package. 有关辅助角色配置文件的信息,请参阅 Integration Services (SSIS) Scale Out 辅助角色For info about the worker configuration file, see Integration Services (SSIS) Scale Out Worker.

  • 使用值 0 指示并非允许所有 Scale Out Workers 执行包。Use the value of 0 to indicate that not all Scale Out Workers are allowed to execute the package. @useanyworker 设为 false 时,必须指定通过使用 Scale Out Manager 或调用存储过程 [catalog].[add_execution_worker] 允许运行包的辅助角色。When you set @useanyworker to false, you have to specify the workers that are allowed to run the package by using Scale Out Manager or by calling the stored procedure [catalog].[add_execution_worker]. 如果指定的辅助角色已在运行另一个包,则该辅助角色会先完成运行当前的包,然后再请求执行另一个。If you specify a worker that's already running another package, the worker finishes running the current package before it requests another execution.

此参数可选。This parameter is optional. 如果未指定,其值设置为 1。If not specified, its value is set to 1. useanyworker 为 bit。The useanyworker is bit.

[@execution_id =] execution_id[@execution_id =] execution_id
返回执行实例的唯一标识符。Returns the unique identifier for an instance of execution. execution_id 为 bigint。The execution_id is bigint.

RemarksRemarks

使用执行来指定参数值,包在单个包执行实例中将使用这些参数值。An execution is used to specify the parameter values that are a package uses during a single instance of package execution.

如果使用 reference_id 参数指定某个环境引用,则该存储过程将使用对应环境变量中的文本值或引用值填充项目和包参数。If an environment reference is specified with the reference_id parameter, the stored procedure populates the project and package parameters with literal values or referenced values from the corresponding environment variables. 如果指定了环境引用,则在包执行过程中将使用默认参数值。If environment reference is specified, default parameter values are used during package execution. 若要精确确定将哪些值用于特定执行实例的值,应使用此存储过程中的 execution_id 输出参数值,并查询 execution_parameter_values 视图。To determine exactly which values are used for a particular instance of execution, use the execution_id output parameter value from this stored procedure and query the execution_parameter_values view.

在执行中只能指定标记为入口点包的包。Only packages that are marked as entry point packages can be specified in an execution. 如果指定的包不是入口点,则执行失败。If a package that is not an entry point is specified, the execution fails.

示例Example

以下示例调用 catalog.create_execution 来创建 Child1.dtsx 包(不在 Scale Out 中)的执行实例。Integration Services Project1 包含该包。The following example calls catalog.create_execution to create an instance of execution for the Child1.dtsx package, which is not in Scale Out. Integration Services Project1 contains the package. 该示例调用 catalog.set_execution_parameter_value 来设置 Parameter1、Parameter2 和 LOGGING_LEVEL 参数的值。The example calls catalog.set_execution_parameter_value to set values for the Parameter1, Parameter2, and LOGGING_LEVEL parameters. 该示例调用 catalog.start_execution 启动一个执行实例。The example calls catalog.start_execution to start an instance of execution.

Declare @execution_id bigint  
EXEC [SSISDB].[catalog].[create_execution] @package_name=N'Child1.dtsx', @execution_id=@execution_id OUTPUT, @folder_name=N'TestDeply4', @project_name=N'Integration Services Project1', @use32bitruntime=False, @reference_id=Null  
Select @execution_id  
DECLARE @var0 sql_variant = N'Child1.dtsx'  
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id, @object_type=20, @parameter_name=N'Parameter1', @parameter_value=@var0  
DECLARE @var1 sql_variant = N'Child2.dtsx'  
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id, @object_type=20, @parameter_name=N'Parameter2', @parameter_value=@var1  
DECLARE @var2 smallint = 1  
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id, @object_type=50, @parameter_name=N'LOGGING_LEVEL', @parameter_value=@var2  
EXEC [SSISDB].[catalog].[start_execution] @execution_id  
GO  

返回代码值Return Code Value

0(成功)0 (success)

结果集Result Sets

NoneNone

权限Permissions

此存储过程需要下列权限之一:This stored procedure requires one of the following permissions:

  • 针对项目的 READ 和 EXECUTE 权限,如果适用,则需要针对引用环境的 READ 权限READ and EXECUTE permissions on the project and, if applicable, READ permissions on the referenced environment

  • ssis_admin 数据库角色的成员资格Membership to the ssis_admin database role

  • sysadmin 服务器角色的成员资格Membership to the sysadmin server role

如果 @runinscaleout 为 1,则此存储过程需要下列权限之一:If @runinscaleout is 1, the stored procedure requires one of the following permissions:

  • ssis_admin 数据库角色的成员资格Membership to the ssis_admin database role

  • ssis_cluster_executor 数据库角色的成员资格Membership to the ssis_cluster_executor database role

  • sysadmin 服务器角色的成员资格Membership to the sysadmin server role

错误和警告Errors and Warnings

下面的列表描述了一些可引发错误或警告的情况:The following list describes some conditions that can raise an error or warning:

  • 该包不存在。The package does not exist.

  • 用户不具备适当的权限。The user does not have the appropriate permissions.

  • 环境引用 reference_id 无效。The environment reference, reference_id, is not valid.

  • 指定的包不是入口点包。The package that is specified is not an entry point package.

  • 引用环境变量的数据类型不同于项目或包参数的数据类型。The data type of the referenced environment variable is different from the data type of the project or package parameter.

  • 项目或包包含需要值的参数,但尚未分配任何值。The project or package contains parameters that require values, but no values have been assigned.

  • 无法在环境引用 reference_id 所指定的环境中找到引用的环境变量。The referenced environment variables cannot be found in the environment that the environment reference, reference_id, specifies.

另请参阅See Also

catalog.start_execution(SSISDB 数据库) catalog.start_execution (SSISDB Database)
catalog.set_execution_parameter_value(SSISDB 数据库)catalog.set_execution_parameter_value (SSISDB Database)
catalog.add_execution_worker(SSISDB 数据库)catalog.add_execution_worker (SSISDB Database)