由于超时,Integration Services在中同步运行包失败



我正试图使用create-execution命令从存储过程中执行SSIS包,但我需要知道包何时完成其工作,所以请使用SYNCHRONIZE参数,问题是以SYNCHRONZED的身份运行ot会失败,并显示超时和状态"意外终止";30秒后,但当我运行非同步时,一切都很好,请你帮忙。

这是我的程序:

ALTER procedure [dbo].[sp_upload] 
as
begin
declare @execution_id bigint
EXEC [SSISDB].[catalog].[create_execution] @package_name=N'Package.dtsx',
@execution_id=@execution_id OUTPUT,
@folder_name=N'Folder',
@project_name=N'Project',
@use32bitruntime=False,
@reference_id=Null
DECLARE @var0 smallint = 1
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id,
@object_type=50,
@parameter_name=N'LOGGING_LEVEL',
@parameter_value=@var0
EXEC [SSISDB].[catalog].[set_execution_parameter_value] @execution_id,  
@object_type=50, 
@parameter_name=N'SYNCHRONIZED', 
@parameter_value=1
EXEC [SSISDB].[catalog].[start_execution] @execution_id
Select @execution_id
end

当我使用参数N'SYNCHRONIZED值=0运行它时,它运行正常,但如果我将其更改为1,它会在30秒后超时而失败。

我需要它是同步的,因为在报告执行id之前,我需要知道包什么时候完成它的工作。

谢谢

这里的错误不是包执行,而是您的使用。

假设包运行需要45秒。您已在过程中将Synchronized设置为true,并从SSMS运行它。45秒后,它完成了。

同样的设置,但现在你可以从你的.net应用程序中运行它。30秒后,砰的一声,暂停糟糕的事情发生了。发生的情况是,默认的30秒命令超时正在向您袭来。

SqlCommand command = new SqlCommand();
// Change execution timeout to 50 seconds to ensure our 45 second process runs
command.CommandTimeout = 50;
command.CommandType = CommandType.Text;
command.Text = "EXECUTE dbo.sp_upload";

最新更新