如何避免SSIS FTP任务在无文件下载时失败? [英] How to avoid SSIS FTP task from failing when there are no files to download?

查看:241
本文介绍了如何避免SSIS FTP任务在无文件下载时失败?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用SQL Server 2005,并在SSIS中创建ftp任务。

有时候会有文件被ftp覆盖,有时不会。如果没有文件,我不希望任务或包失败。我已经改变了从ftp任务到完成的下一步的箭头,所以程序包会一直运行。我已将允许的错误数量更改为4(因为有4个ftp任务,并且4个目录中的任何一个都可能有也可能没有文件)。 但是,当我从代理中的作业运行包时,它将该作业标记为失败。由于这将每15分钟运行一次,因此我不想在工作历史中出现一堆红色的x,这会导致我们在确实发生问题时看不到问题。



如何在ftp任务中设置属性,以便找不到文件到ftp不是失败?我正在使用的操作是发送文件。



以下是一些更多信息:这些文件位于服务器上,除了ftp外,我没有任何访问权限。而且,我不会提前知道文件名。用户可以随心所欲地给他们打电话。所以我无法检查具体的文件,也没有,我认为我可以检查。除了通过使用基于该连接的ftp连接和任务。这些文件位于远程服务器上,我想将它们复制到我的服务器上,以从远程服务器获取它们。



我可以将命令级ftp一个脚本任务。也许这就是我需要使用的而不是一个ftp任务。 (我已经更改为使用ftp命令行,带有从脚本任务调用的参数文件,当没有文件时,不会发生错误,我认为该解决方案对我有用。参数文件是动态的,这意味着我不需要在纯文本文件中具有连接信息,而是可以存储在配置文件中,该文件位于更安全的位置。)

解决方案

检查 link ,它描述了如何在SSIS包中正常处理任务错误。



我几乎一样问题,但与检索文件。当在FTP服务器上找不到文件时,我希望包不会失败。上述链接可以防止错误冒泡并导致程序包失败;你会认为FailPackageOnError = false应该做的事情? :-S



希望这能为您解决它!


I'm using SQL Server 2005, and creating ftp tasks within SSIS.

Sometimes there will be files to ftp over, sometimes not. If there are no files, I don't want the task nor the package to fail. I've changed the arrow going from the ftp task to the next to "completion", so the package runs through. I've changed the allowed number of errors to 4 (because there are 4 ftp tasks, and any of the 4 directories may or may not have files).

But, when I run the package from a job in agent, it marks the job as failing. Since this will be running every 15 minutes, I don't want a bunch of red x's in my job history, which will cause us to not see a problem when it really does occur.

How do I set the properties in the ftp task so that not finding files to ftp is not a failure? The operation I am using is "Send files".

Here is some more information: the files are on a server that I don't have any access through except ftp. And, I don't know the filenames ahead of time. The user can call them whatever they want. So I can't check for specific files, nor, I think, can I check at all. Except through using the ftp connection and tasks based upon that connection. The files are on a remote server, and I want to copy them over to my server, to get them from that remote server.

I can shell a command level ftp in a script task. Perhaps that is what I need to use instead of a ftp task. (I have changed to use the ftp command line, with a parameter file, called from a script task. It gives no errors when there are no files to get. I think this solution is going to work for me. I'm creating the parameter file dynamically, which means I don't need to have connection information in the plain text file, but rather can be stored in my configuration file, which is in a more secure location.)

解决方案

Check this link that describes about gracefully handling task error in SSIS Package.

I had almost the same problem but, with retrieving files. I wanted the package NOT to fail when no files were found on FTP server. The above link stops the error bubbling up and causing the package to fail; something you would have thought FailPackageOnError=false should have done? :-S

Hope this solves it for you too!

这篇关于如何避免SSIS FTP任务在无文件下载时失败?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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