The task will detect changes to existing files as well as new files, both actions will cause the file to be found when available. A file is available when the task can open it exclusively. This is important for files that take a long time to be written, such as large files, or those that are just written slowly or delivered via a slow network link. It can also be set to look for existing files first (1.2.4.55).
The full path of the found file is returned in up to three ways:
The ExecValueVariable of the task. This can be set to any String variable.
The OutputVariableName when specified. This can be set to any String variable.
The FullPath variable within OnFileFoundEvent. This is a File Watcher Task specific event.
Advanced warning of a file having been detected, but not yet available is returned through the OnFileWatcherEvent. This event does not always coincide with the completion of the task, as completion and the OnFileFoundEvent is delayed until the file is ready for use. This event indicates that a file has been detected, and that file will now be monitored until it becomes available. The task will only detect and report on the first file that is created or changes, any subsequent changes will be ignored.
Task properties and there usages are documented below:
| Property |
Data Type |
Description |
| Filter |
String |
Default filter *.* will watch all files. Standard windows wildcards and patterns can be used to restrict the files monitored. |
| FindExistingFiles |
Boolean |
Indicates whether the task should check for any existing files that match the path and filter criteria, before starting the file watcher. |
| IncludeSubdirectories |
Boolean |
Indicates whether changes in subdirectories are accepted or ignored. |
| OutputVariableName |
String |
The name of the variable into which the full file path found will be written on completion of the task. The variable specified should be of type string. |
| Path |
String |
Path to watch for new files or changes to existing files. The path is a directory, not a full filename. For a specific file, enter the file name in the Filter property and the directory in the Path property. |
| PathInputType |
FileWatcherTask.InputType |
Three input types are supported for the path:
Connection - File connection manager, of type existing folder.
Direct Input - Type the path directly into the UI or set on the property as a literal string.
Variable – The name of the variable which contains the path. |
| Timeout |
Integer |
Time in minutes to wait for a file. If no files are detected within the timeout period the task will fail. The default value of 0 means infinite, and will not expire. |
| TimeoutAsWarning |
Boolean |
The default behaviour is to raise an error and fail the task on timeout. This property allows you to suppress the error on timeout, a warning event is raised instead, and the task succeeds. The default value is false. |
The component is provided as an MSI file, however to complete the
installation, you will have to add the transformation to the Visual
Studio toolbox by hand. This process has been described in detail in
the related FAQ entry for How do I install a task or transform component?, just select File Watcher Task from the SSIS Control Flow Items list in the Choose Toolbox Items window.
Downloads
The File Watcher Task is available for both SQL Server 2005 and SQL Server 2008. Please choose the version to match your SQL Server version, or you can install both versions and use them side by side if you have both SQL Server 2005 and SQL Server 2008 installed.
File Watcher Task for SQL Server 2005
File Watcher Task for SQL Server 2008
Version History
SQL Server 2008
Version 2.0.0.14 - Fixed user interface bug. A migration problem caused the UI type editors to reference an old SQL 2005 assembly.
(17 Nov 2008)
Version 2.0.0.7 - SQL Server 2008 release.
(20 Oct 2008)
SQL Server 2005
Version 1.2.6.100 - Fixed UI bug with TimeoutAsWarning property not saving correctly. Improved expression support in UI. File availability detection changed to use read-only lock, allowing reduced permissions to be used. Corrected installed issue which prevented installation on 64-bit machines with SSIS runtime only components.
(18 Mar 2007)
Version 1.2.5.73 - Added TimeoutAsWarning property. Gives the ability to suppress the error on timeout, a warning event is raised instead, and the task succeeds. (Task Version 3)
(27 Sep 2006)
Version 1.2.4.61 - Fixed a bug which could cause a loop condition with an unexpected exception such as incorrect file permissions.
(20 Sep 2006)
Version 1.2.4.55 - Added FindExistingFiles property. When true the task will check for an existing file before the file watcher itself actually starts. (Task Version 2)
(8 Sep 2006)
Version 1.2.3.39 - SQL Server 2005 RTM Refresh. SP1 Compatibility Testing. Property type validation improved.
(12 Jun 2006)
Version 1.2.1.0 - SQL Server 2005 IDW 16 Sept CTP. Futher UI enhancements, including expression indicator. Fixed bug caused by execution within loop Subsequent iterations detected the same file as the first iteration. Added IncludeSubdirectories property. Fixed bug when changes made in subdirectories, and folder change was detected, causing task failure. (Task Version 1)
(6 Oct 2005)
Version 1.2.0.0 - SQL Server 2005 IDW 15 June CTP. Changes made include an enhanced UI, the PathInputType property for greater flexibility with path input, the OutputVariableName property, and the new OnFileFoundEvent event.
(7 Sep 2005)
Version 1.1.2 - Public Release
(16 Nov 2004)
Screenshots
Troubleshooting
Make sure you have downloaded the version that matches your version of SQL Server. We offer separate downloads for SQL Server 2005 and SQL Server 2008.
Once installation is complete you need to manually add the task to the toolbox before you will see it and to be able add it to packages - How do I install a task or transform component?
If you are still having issues then you can contact us, but please provide as much detail about error as possible, as well as which version of the the task you are using and details of the SSIS tools installed.