且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

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

更新时间:2023-11-25 22:22:58

好的,你将不得不拥有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[^]