我有一个带有脚本任务的控制流,用于检查文件是否存在,如果存在则会移动到数据流任务上。如果没有找到,那么它将转到SQL任务,该任务将详细信息写入错误日志,之后它应移动到下一个要检查的文件上。不幸的是,它在更新后停止了SQL任务。
我尝试在SQL任务之后更改约束但没有成功。
尽管搜索找不到答案!!!
帮助大多数人赞赏。 感谢
抱歉,我无法上传图片,但这里是SkyDrive上的 link图片。
我有一个来自每个脚本任务的约束,它基本上检查包含文件名称的变量,如果找到则运行数据流,如果没有写入错误。这是一个更大的循环的一部分,它查找自上次处理以来包含时间戳的文件。
虽然我注意到即使第一个文件存在,但控制流程在数据流之后停止,现在我很困惑!!!!!
由于
日志:
SSIS package "P76import.dtsx" starting. Information: 0x4004300A at Process P76 Adjustments file, SSIS.Pipeline: Validation phase is beginning. Information: 0x40043006 at Process P76 Adjustments file, SSIS.Pipeline: Prepare for Execute phase is beginning. Information: 0x40043007 at Process P76 Adjustments file, SSIS.Pipeline: Pre-Execute phase is beginning. Information: 0x402090DC at Process P76 Adjustments file, P76 Adjustments File [368]: The processing of file "C:\Mark\P76\ImportFiles\P76_ADJUSTMENTS_20130408.csv" has started. Information: 0x400490F4 at Process P76 Adjustments file, Lookup [438]: component "Lookup" (438) has cached 4 rows. Information: 0x400490F5 at Process P76 Adjustments file, Lookup [438]: component "Lookup" (438) has cached a total of 4 rows. Information: 0x402090E2 at Process P76 Adjustments file, Lookup [438]: The component "Lookup" (438) processed 4 rows in the cache. The processing time was 0.015 seconds. The cache used 4208 bytes of memory. Information: 0x4004300C at Process P76 Adjustments file, SSIS.Pipeline: Execute phase is beginning. Information: 0x402090DE at Process P76 Adjustments file, P76 Adjustments File [368]: The total number of data rows processed for file "C:\Mark\P76\ImportFiles\P76_ADJUSTMENTS_20130408.csv" is 1486. Information: 0x402090DF at Process P76 Adjustments file, Invalid rows to Error table [176]: The final commit for the data insertion in "component "Invalid rows to Error table" (176)" has started. Information: 0x402090E0 at Process P76 Adjustments file, Invalid rows to Error table [176]: The final commit for the data insertion in "component "Invalid rows to Error table" (176)" has ended. Information: 0x402090DF at Process P76 Adjustments file, Transactions table [411]: The final commit for the data insertion in "component "Transactions table" (411)" has started. Information: 0x402090E0 at Process P76 Adjustments file, Transactions table [411]: The final commit for the data insertion in "component "Transactions table" (411)" has ended. Information: 0x40043008 at Process P76 Adjustments file, SSIS.Pipeline: Post Execute phase is beginning. Information: 0x402090DD at Process P76 Adjustments file, P76 Adjustments File [368]: The processing of file "C:\Mark\P76\ImportFiles\P76_ADJUSTMENTS_20130408.csv" has ended. Information: 0x4004300B at Process P76 Adjustments file, SSIS.Pipeline: "component "Invalid rows to Error table" (176)" wrote 0 rows. Information: 0x4004300B at Process P76 Adjustments file, SSIS.Pipeline: "component "Transactions table" (411)" wrote 1485 rows. Information: 0x40043009 at Process P76 Adjustments file, SSIS.Pipeline: Cleanup phase is beginning. SSIS package "P76import.dtsx" finished: Success.
答案 - 通过评论 问题是进入“检查是否有文件”脚本任务的约束都没有设置为True !!
答案 0 :(得分:2)
如果您制作流程或而不是AND它将起作用。 目前,BOTH组件必须评估为true。 如果任何组件评估为true,则OR将起作用。 右键单击流程并根据图像进行编辑。
答案 1 :(得分:1)
“在P76调整文件后”双击绿色链接,您将在“多重约束”框中选择第二个单选按钮,即“逻辑或。一旦约束必须评估为真”,将获得“优先约束编辑器”;你的问题会得到解决。
对剩余的事情做同样的改变......
答案 2 :(得分:0)
您的问题是,您在comntrol流程中有两条通往同一任务的路径,但这根本不起作用。
您可以做的是设置一个变量,例如fileABCfound,true或false,具体取决于是否找到该文件。然后在流程步骤中,转到属性并为Disbale设置exproession,如果变量为false,将禁用该任务。这样做而不是将表达式放在连接器中。这样,如果找不到该文件,它将禁用该任务并移至下一个任务。