如何创建CmdExec SSIS作业以检查文件夹中是否存在文件

问题描述:

嗨朋友们,我需要创建一个工作,它将查看文件夹以查看文件是否存在,然后调用存储过程以在文件进入时运行。作业必须正在侦听该文件夹文件到达。任何帮助??



谢谢你

Hi friends, I have need to create a job which will be looking into a folder to see if files exists and then call a stored procedure to run when a file gets in. The job will have to be listening to that folder for file arrival. Any help??

Thank you

好的,你将不得不拥有ssis某种类型的监视器可以触发一个可以执行ssis包的事件。



这真的不是SSIS的设计目的。



你真正需要做的是创建一个Windows服务。在此服务中,我建议您在要监视的文件夹上实现FileSystemWatcher。使用在某些更改时触发的事件,您可以直接执行proc。但是如果您需要在SSIS包中进行处理,那么只需执行传递fileinfo详细信息的包。



下面的一些参考:



创建简单的Windows服务 [ ^ ]



http: //blogs.msdn.com/b/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx [ ^ ]
ok, with ssis you are going to have to have some sort of monitor that fires an event which could then execute the ssis package.

This is really not what SSIS is designed for.

What you really need to do is create a windows service. In this service I would recommend you implement the FileSystemWatcher on the folder you want to monitor. Using the events that get fired when something changes, you can then execute a proc directly. If however you need the processing within the SSIS package then just execute the package passing in the fileinfo details.

some references below:

Creating a simple Windows Service[^]

http://blogs.msdn.com/b/michen/archive/2007/03/22/running-ssis-package-programmatically.aspx[^]