Sql server 2008R2 SSIS创建文件夹时的怪异 [英] Sql server 2008R2 SSIS weirdness when creating folder

查看:124
本文介绍了Sql server 2008R2 SSIS创建文件夹时的怪异的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个包含以下任务的包:



文件系统任务 - 创建一个文件夹(如果它尚不存在)。



文件系统任务 - 如果文件夹中存在则删除文件



FTP任务 - 复制新文件并将它放在文件夹中。



我正在使用变量来确定在包命令行(来自SQL作业)上传递的路径名表格参数。



程序包失败,因为FTP任务找不到文件夹,这是因为文件夹创建任务没有创建文件夹。这几乎就像FTP任务在文件系统任务执行之前运行,或者与文件系统任务同时运行。



我尝试过:



0)如果我在运行作业之前手动创建文件夹,则作业会成功运行。



1)如果我让包尝试创建文件夹,它在FTP任务失败,因为我指定的文件夹不存在,因为它不是由文件夹创建任务创建的。



3)我尝试将下一个任务箭头设置为完成和成功,但我得到相同的结果。



4我尝试在所有任务之间添加执行 WAITFOR DELAY '00:00:05'的SQL任务。



5)如果我在包中禁用FTP任务,文件夹创建任务会成功创建文件夹。



重要注意事项-------------------------------------- ---------------------



我不想为此使用脚本任务。



我不想创建另一个包来处理文件系统任务。

I have a package with the following tasks:

File System task - Create a folder if it doesn't already exist.

File System task - Delete file if it exists in the folder

FTP task - copies new file and places it in the folder.

I'm using variables to determine the path name form parameters passed on the package command line (from a SQL job).

The package fails because the FTP task can't find the folder, which is cause by the fact that the folder-creating task is not creating the folder. It's almost as if the FTP task is running BEFORE the file system tasks have executed, or concurrently with the files system tasks.

What I have tried:

0) If I create the folder manually before running the job, the job runs successfully.

1) If I let the package try to create the folder, it fails at the FTP task because the folder I specified doesn't exist because it wasn't created by the folder creation task.

3) I tried setting the "next task" arrow to both completion and success, but I get the same result.

4) I tried adding SQL tasks that performed WAITFOR DELAY '00:00:05' between all of the tasks.

5) If I disable the FTP task in the package, the folder creating task creates the folder successfully.

IMPORTANT TO NOTE -----------------------------------------------------------

I do NOT want to use a script task for this.

I do NOT want to create another package just to handle the files system tasks.

推荐答案

摘要导致解决方案的评论:



我首先建议检查优先约束。我的问题清楚地说明了SQL2008R2,这些问题直到晚些时候(2014年?)才出现。



但是我也建议使用Sequence Containers ..这似乎是做的伎俩。



我会尝试在一段时间内发布文档的链接,如果希腊文中有任何结果,请致歉(电话有一个有趣的时刻)



编辑...这是链接, SQL-BI的提示与技巧:SSIS中的序列容器 [ ^ ]
Summary of the comments which led to a solution:

I first suggested checking the Precedence Constraints. My bad as the question clearly states SQL2008R2 and these didn't come along until later (2014?).

However I also suggested using Sequence Containers.. which seemed to do the trick.

I'll try to post a link to the docs in a moment and apologies if any of this turns out in Greek (phone is having a funny moment)

Edit...here's the link, Tips and Tricks for SQL-BI: Sequence Container in SSIS[^]


这篇关于Sql server 2008R2 SSIS创建文件夹时的怪异的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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