![](/img/trans.png)
[英]SQL Server Exception:Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
[英]Execute package in ssis causes Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding
我有这个代码
var connection = new SqlConnection(System.Configuration.ConfigurationManager.ConnectionStrings["SSIS"].ConnectionString);
var integrationServices = new IntegrationServices(connection);
var package = integrationServices
.Catalogs["SSISDB"]
.Folders["MYFOLDER"]
.Projects["MYPROJECT"]
.Packages["MYPACKAGE.dtsx"];
var executionParameters = new System.Collections.ObjectModel.Collection<Microsoft.SqlServer.Management.IntegrationServices.PackageInfo.ExecutionValueParameterSet>();
var executionParameter = new Microsoft.SqlServer.Management.IntegrationServices.PackageInfo.ExecutionValueParameterSet();
executionParameter.ObjectType = 50;
executionParameter.ParameterName = "SYNCHRONIZED";
executionParameter.ParameterValue = 1;
executionParameters.Add(executionParameter);
long executionIdentifier = package.Execute(true, null, executionParameters);
我一调用package.Execute,就会导致错误超时过期。 操作完成之前经过的超时时间或服务器未响应
如果删除参数executionParameter.ParameterName =“ SYNCHRONIZED”,则会解决问题。 但我想进行调用以同步执行。
任何想法如何解决这个问题? 谢谢
似乎执行程序包有30秒超时,您无法覆盖它。 您可能需要通过异步执行程序包然后等待其完成来克服此限制。 见下文
ExecutionOperation operation = ssisServer.Catalogs["SSISDB"].Executions[executionIdentifier];
while (!operation.Completed))
{
operation.Refresh();
// Wait before refreshing again
System.Threading.Thread.Sleep(500);
}
请参阅此链接以获取更多详细信息
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.