没有文件要处理时,如何防止Excel导入SSIS包中? [英] How to prevent Excel import in SSIS package when there is no file to process?

查看:49
本文介绍了没有文件要处理时,如何防止Excel导入SSIS包中?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个导入Excel文件的SSIS包.在程序包内部,我有一个脚本任务,该脚本任务在执行Excel导入过程之前检查Excel文件是否存在.

I have an SSIS package that imports Excel files. Inside the package, I have a Script task that checks whether the Excel file exists or not before executing the Excel import process.

由于 AcquireConnection 错误,我无法执行Excel文件不存在的程序包.

I am unable to execute the package when the Excel file doesn't exist because of the AcquireConnection error.

在没有可导入的Excel文件时如何阻止程序包执行?

How can I prevent the package from executing when there is no Excel file available for import?

推荐答案

执行以下步骤,以避免软件包失败.

Perform the following steps to avoid the package from failing.

  • Excel Source 上的 ValidateExternalMetadata 属性设置为 False .
  • Excel Connection 上的 DelayValidation 属性设置为 True .
  • Set the ValidateExternalMetadata property on the Excel Source to False.
  • Set the DelayValidation property on the Excel Connection to True.

程序包验证阶段首先发生,甚至在脚本任务可以执行之前.如果Excel文件不存在,则程序包验证阶段将失败.设置以上属性值将延迟验证,您可以检查脚本任务中是否存在第一个属性.如果该文件不存在,则可以中止软件包的执行.

The package validation phase happens first even before your Script task can execute. If the Excel file, doesn't exist then the package validation phase will fail. Setting the above property values will delay the validation and you can check if the first exist or not in your script task. If the file doesn't exist, you can abort the package execution.

这篇关于没有文件要处理时,如何防止Excel导入SSIS包中?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆